fix(realtime): subscribed state#2438
Conversation
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
|
@edgurgel thoughts? |
|
Hey team I'm going to play with this branch for some days! Thanks for the PR 🙇 |
|
Nice, thanks @edgurgel ! Can you please ping me once you've tested and are ok to merge? |
|
Hey @7ttp here is my initial feedback:
|
addressed! added the pending system ready timeout.... edit: QQ: any update on this? 🙂 |
|
Thanks @7ttp ! Will play with the error states and time outs and get back to you! Looking good so far! <3 |
|
Sorry for the delay! I've tested with a few error cases and at least one missing thing is: When there is a timeout a channel with only pg changes does not try to "rejoin" like a normal timeout. So we would need to actually leave the channel and then start a rejoin timer to simulate what a Because this is starting to feel very complicated (and a bit hacky) we discussed with the team and we agreed that we would rather move this to the backend (and option to wait for the subscription on join) and simplify not only this client but all clients. Appreciate the patience and the help @7ttp. Sorry if we couldn't proceed with this one! |
|
Thank you @edgurgel |
makes sense, ty! 🙂💚 |
TL;DR
Delay
SUBSCRIBEDonly for channels that bindpostgres_changescallbacks exclusivelyand keep the existing timing for mixed channels
Prob:
SUBSCRIBEDcould be emitted before the Postgres change feed was actually readywhich made postgres-only channels look ready too early
so now basically, wait for the
postgres_changessystem ready message before emittingSUBSCRIBEDfor postgres-only channels while leaving channels with
broadcastorpresencecallbacks unchangedref:
aligned with Eduardo’s suggestion :D