Created a game on my site, not all scores populating to tables on Supa
Hey guys - Background quick:
Created a flappy bird style game on my website, set up (through AI) my tables to calculate scores. I had over 10,000 entries (attempts) this weekend, but for some reason not ALL the scores logged. Had several users submit screenshots with high scores that did not populate.
I'm wondering what the limiting factor was? If it was a mobile vs desktop issue but scores from both were populated.
Thanks for any tips! Let me know what else is needed to help solve the issues
4 Replies
You would probably need errors from the logs, or some example of how you are updating things.
One thing to remember if you read a value from supabase then update it using the client as two calls another user could have done the same thing and their update if between the two calls here would be overwritten if the same row.
Hey! Thanks for the info -
✅ The Complete Flow:
Player finishes game → Game.js sends score via postMessage
React receives score → FlappyFlunkWindow.tsx catches the message
Wallet validation → Checks if player is connected via Flow
API submission → POST to /api/flappyflunk-score
Database storage → Saved to flappyflunk_scores table in Supabase
Leaderboard update → New score appears in rankings
Should be flawless but not recognizing certain users
If you need to see the coding i'm more than happy to provide!
You need to present whatever it takes to get help. I may or may not be the one to help you.
Inserts would generate an error, you should check the logs.
Updates might not error if RLS is involved.
There are not likely Supabase bugs involved with this, so you will need to debug your app, generate more logging if you don't have it etc.
If you are updating a common row for multiple users then I would look carefully at any state you maintain in the app from a read of that row until you update it. That is a prime reason for multiple user state being missed. But there could be errors or RLS that could also cause it.
Also you will find most help here for errors or solving something you have narrowed down. Not just showing a repository and wanting someone to debug it.
Also the Gateway API log has the ability to show operations for specific user ids if you know one that is failing.
love this info... thank you so much. Let me go tinker around and see what i can find that will be helpful getting to the bottom of this!