Hi everyone. I have this strange bug with my realtime feed.
So I have this “Tasks” page with Feed. I have a collection that takes tasks from Supabase table and filters them by user_id.
When I was testing everything worked fine until few people started to create tasks simultaneously.
Bug itself:
Other’s people tasks are appearing in other’s people feeds. I can even see that user_id in Feed item is different.
Data is pulling from realtime Supabase table.
Hope for a quick answer and fix if this bug is on your side, and not mine.
Hey @nekitonn
A few questions to better understand. I’m no expert in realtime though.
→ are you filtering on your userId
when binding your collection in your page ? Or are you filtering when fetching your collection? If you’re filtering when displaying the data and you have a breach in the confidentiality you should really filter when fetching the data.
→ How do you assign the task to the user that create the task? (aka the INSERT operation). Is this a trigger in your DB? Is this a value that comes from the front? But I see that the toogle to ignore if empty is OFF so even with empty userID this shouldn’t be a problem.
Let us know.
Have a nice day.
Matth-
@Matthieu Thank you for the quick answer.
- I’m filtering on the fetch side (Image from collection filters)
- I do REST API query including userId in body, which then writes into DB. I write it into DB at the same time with every other task information.
One more detail: this “not this user’s task” stays there until page refresh. That in disappears
1 Like
As I understand “It’s not a bug, it’s a feature”
Answer from @Mael from WeWeb Support:
"You have the behavior because your table are realtime
With realtime, we don’t fetch the data again
We just push the new data every time a row is updated or added
Why are-you using realtime? What is your use case?"
I want to show status of tasks for my users in realtime, because time to do the task is short (1-2 minutes), so there’s no need to leave the website or page for my users. So when status is updated on the backend, I want a user to see it right away wothout the need to refresh the page and sending emails or whatever.
Seems like I fixed it by turning off INSERT from realtime