Rank 2: Process
Mobile
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
Mobile
Admin
womp..i don't think the dev tools logs web sockets very well...
Are you maybe subscribing before the user has a valid session?
Rank 2: Process
but it does work when i sign out of appwrite and sign in again
Admin
It could be something with the order of things being executed on app start up.
Rank 2: Process
i am getting this in debug console -
I/flutter (30045): subscription: null
Admin
Last url is null for some reason: https://github.com/appwrite/sdk-for-flutter/blob/54f30faa4a4fab2af0fe57c172550b288c9cbb4b/lib/src/realtime_mixin.dart#L43
Rank 2: Process
how can i correct that
Rank 2: Process
i just hot reloaded and it started working but then reloaded again and stopped working :_
Admin
there's some race condition going on with your app such that the connection is being closed while another one is trying to start (you're unsubscribing and subscribing in multiple places of your app. Try to use multiple realtime instances
Rank 2: Process
wdym 'unsubscribing' ?
Admin
sorry, i mean when you call close() on the subscription
Rank 2: Process
but i am not calling close() anywhere
Admin
Realtime subscription null
Admin
the web socket is closing for some reason 🤷🏼♂️
Rank 3: Container
this is happening on app start ?
Rank 3: Container
if this so then, check user id should not be null on startup or while calling subscription .this will remove the error. hope this will work
Rank 2: Process
it worked, Thanks a lot dude!! @conqueror
Admin
[SOLVED] Realtime subscription null
Rank 1: Thread
i have the exact same problem and the exact same architecture but i am still to start a subscription at one place but not at other
Rank 2: Process
Your realtime not working in user profile?
Rank 2: Process
Or not even in user posts?
Rank 1: Thread
realtime is working properly when trying to load new posts but when i go to a userProfile the error shows up
Rank 2: Process
Ah I’m also kinda stuck there but I haven’t looked into it that much , I will let you know when it’s done
Rank 1: Thread
ok thanks
Admin
Try using a different/new realtime instance.
Btw, it's best to create a new post in #channel