Records found that don't exist (Supabase + Prisma)

I've got a very wierd bug I can't figure out. I've deleted all my records in Supabase for table upvote, but I am somehow able to find a non-existant record and delete it! When adding an upvote, I'm checking for a record. If one exists already, I delete it, if not I create one. Even after clearing the table, it is able to find an existing record and try to delete it (even with a success message) although no record should even exist. I'm baffled. On top of this, I have bizarre random 500 internal server error when I create or delete a record (same method as above). It works most of the time, but sometimes it fails on either create or delete. It is NOT due to a race condition as I've already troubleshot that possibility out. This is a simple CRUD operation and I don't understand where the issue is. Perhaps something with Supabase serving old records? I've tried to wait awhile after clearing the table, but that didn't fix the issue of deleting records that don't exist. I've restarted the server after clearing the records and I have no local data that is conflicting with this (as I'm querying the table directly). The first attached image shows it finding a record, but I assure you my table is empty! The second image shows my current methods, in case I'm doing something wrong. Help with either of the strange above issues would be very helpful. I'm using: "prisma": "5.17.0", "@prisma/client": "5.17.0", "@prisma/extension-accelerate": "^1.1.0", "nuxt": "^3.13.0", "@nuxtjs/supabase": "^1.3.5",
No description
No description
2 Replies
TitusDecali
TitusDecali3w ago
Stack Overflow
Records found that don't exist
I've got a very wierd bug I can't figure out. I've deleted all my records in Supabase for table upvote, but I am somehow able to find a non-existant record and delete it! When adding an upvote, I'm
Psuedo
Psuedo3w ago
Make sure to add the '✅ Solved' tag
Want results from more Discord servers?
Add your server