I’m encountering an issue with a collection list connected to my Supabase database. The collection is bound to the profile table, and the data updates correctly in the database when changes are made. However, there is a display issue in the collection list when two rows share the same value in a column.
Here’s the problem:
When I update one row, both rows with the same initial value display the updated value in the UI.
In the Supabase database, only the correct row is updated, as expected.
Refreshing the page fixes the display issue, and the values are correctly shown.
My workflow is simple: on a change in the select dropdown, I update the database with the selected value for the correct row.
If anyone has encountered a similar issue or has a solution, I would appreciate your help.
This is definitely something with your front end, not Supabase.
Typically when you make a change to your backend, you want to also make that change on your front end as well. The variable in which you’re storing that data should be updated with the change you just made.
Basically, make your db change, use the option to return the full new row, then your last node should be to remove the old value, and add the new. That way both the Frontend and the backend are synced.
There are many different approaches you can take to accomplish this but the ultimate thing is making sure that your data is synced when it change is made.
I’ve looked at the problem from every angle, and I think there’s a bug in Weweb. After digging deeper into my tests, I noticed the bug only happens when my collection list is sorted by my select input.