Hi I'm having a hard time getting realtime subscri...
# off-topic
a
Hi I'm having a hard time getting realtime subscriptions to work. It used to work fine and sometime over last few weeks in stopped working with no relevant code changse I can find, and I don't understand why. I'm not sure how to debug. Here's the app that is not working: https://replicache-todo-dbpmsba72-rocicorp.vercel.app/d/Ww5BFS. I expect that when I open this in two tabs and make changes, they are replicated in realtime. The realtime subscription bit is very simple. Code here: https://github.com/rocicorp/replicache-todo/pull/17/files#diff-06e55815e321b51ef509e1639acff6e732a58d1af11e9beb00adf987738fac17R19. I have verified that the key and URL are correct. They correspond to the Supabase project here: https://app.supabase.com/project/pfdhjzsdkvlmuyvttfvt. I don't see any errors on either client or server. I verified that RLS is turned off on the table and that the publications are setup. I see the websocket for realtime come up, there's just no messages that ever get sent over it. What am I missing?
Here's the publication setup.
Oh I also tried changing the subscription to
from(*).on(*)
. no change.
I'm going to try creating a new blank project and see if that helps :-/.
PS it also doesn't work on the local dockerized setup.
(and used to)
g
I did a text search and don't see .subscribe() in your code you linked. What client code are you using for supabase? But you do say you have a websocket so I assume you are getting a subscription. Edit... it sets up a websocket even without .subscribe, but does not actually set up the token info to get going.
a
Argh. that was probably it. I feel like I have made this mistake once before with this API.
thanks.
Checking.
g
When working the websocket should have this:
😬
g
LOL And I've helped you before.....
a
thanks for your patience @garyaustin . I must have copied the same mistake from before, then when compared to see what was different, I compared to the broken version.
FWIW, I think my brain expects the callback to go on the last method in the chain.
But the docs show this subscribe() method so... totally my fault. thanks.
4 Views