Hello everyone,
I've been using Appwrite recently, and I have a question regarding realtime that I haven't found an answer to in the documentation.
First of all :
When I initialize my app, I create a "RealtimeSubscription" on "account". I add a listener to react to account changes, and I "close()" / recreate the "RealtimeSubscription" at each login / logout (as specified in the documentation). This whole part works perfectly.
Afterwards :
When the user opens a page with data that must be updated in real time, I create a "RealtimeSubscription" which manages the change in certain documents in the database. This whole part works perfectly.
My issue is the following:
When I open the updated page in realtime, the user part disconnects instantly, and it's the same for the realtime of the page. I have console messages "subscription null" alos that I absolutely did not want the disconnection.
I think I have a poor understanding of Realtime on this aspect of channel/subscription, can you enlighten me?
Sincerely, Disk_MTH
Platform?
Flutter, it's in the tag post 😉
Some words in your desc are in French, do you speak french ?
my bad, i missed it.
no problem
no, btw I don't see anything french though in my profile's desc 😅
my bad the word "Entrepreneur" is the same in both English and French
but as French preople it doesn't sound as a English term
Could you try creating a singleton of Realtime(client) & use that instance across app & see if the disconnection still happens?
I've seen this in apple sdk quite a few times randomly.
Also, appwrite 1.4x with latest sdk?
I've a singleton of Realtime, and I use only this singleton but when I try to subscribe to two channels in the same class, it work, both are updated, but if on is declared, and another when the page show up, both are killed and I dont understand why
on my pubspec.yaml : appwrite: ^11.0.0
it's the last one : https://pub.dev/packages/appwrite
Can you try using subscribe with multiple channels with a singleton subscription? Does that work?
This is what I had thought of using first (it seemed logical to me) but it was when I saw the documentation which said that at each connection/disconnection, it was necessary to stop the realtime and recreate it that I said to myself that I was going to separate the different streams. So I just remerged everything and it works for now (I haven't finished everything yet). On the other hand, contrary to the documentation, I do not need to recreate my channel each time to always have the updates. I'll continue and post if it's definitely fixed or not.
There might still be a bug with the flutter SDK and realtime. For now, can you try using separate realtime instances for each subscription?
That's what I tested basically, and that's what's the problem. I did otherwise: I made 1 single realtime that makes both my accounts and my collections and at each change of account status, I re-call "listen" on my realtime and it works
[SOLVED] Multiple realtime channels with Account
Recommended threads
- Custom Topic sent from Function (with sc...
Can I send a message on a custom topic? So clients can subscribe to them?
- CORS error only on tables db api After u...
I've recently updated my self hosted appwrite instance to the 1.8.0 and updated my frontend with the tables db apis but strangely, even if I'm able to log in, g...
- [SOLVED] Access ExecutionStatus of a fun...
I am calling a cloud function from the newest Flutter SDK 20.2.1with the `xasync: false` flag and get the result, but the `execution.status` is not a String and...