
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
- Appwrite realtime stopped working all of...
In our production environment, Appwrite Realtime suddenly stopped working and no updates are coming through , can you confirm if there are any known issues?
- 503 Timeout when Updating or Upserting D...
Hey I’m running into an issue when trying to update or upsert a row in Appwrite. The request hangs for a while and then throws this error: ``` AppwriteException...
- Realtime Feature Not Working on Custom S...
I have added a custom domain api1.nextsaimon.top for my project. My website is hosted on a1.nextsaimon.top. All features are working correctly, except the Realt...
