r/FlutterDev • u/mladenConcept • Jun 30 '26
Discussion Flutter + Supabase realtime: what broke in v1.0.9 when two people edited at once
Solo dev, Flutter household app, just shipped v1.0.9. Hit a realtime bug I want to talk about.
Setup: Supabase, postgres_changes broadcast, optimistic delete. Worked fine for me testing alone. Tried it on a second phone — same field, same time — last write won silently. No UI feedback. Person A made a change, person B's app happily overwrote it. Embarrassing.
What I did: added a row version column, push conflict events back to the client, app toasts "someone else just changed this." Not great UX but the silent corruption is gone.
Optimistic delete was the next headache. I tombstone the row locally until the server confirms — but RLS can deny a delete (e.g. someone in the household without permission) and I need to put the row back. Problem: the user's already navigated away. Now I keep a local "pending" table and reconcile on app foreground. Took me way too long to land on that.
Avatars: Supabase storage upload, fallback is a CustomPainter that draws initials with a hash-derived color. Avoided another asset lib for what's basically a circle with two letters.
Stack: Flutter stable, Supabase, RevenueCat, Firebase, AdMob with a no-ads-for-paying gate.
Curious how others handle realtime conflict resolution in Flutter — the row version + toast pattern works but I'm not sure it's the right model long-term.
2
u/WheelAdditional6888 Jul 15 '26
This is exactly the kind of issue that never shows up when one person tests alone.
Silent overwrites are especially dangerous because users may not realize anything was lost. The versioning approach sounds solid, but making conflicts visible and recoverable may matter just as much as detecting them.
6
u/[deleted] Jun 30 '26
[removed] — view removed comment
3
u/[deleted] Jul 01 '26
[removed] — view removed comment