
Hello everyone!
I'm using the following sample code to establish a Realtime connection from within my Flutter app:
/// final realtime = Realtime(client);
/// final subscription = realtime.subscribe(['collections']);
/// subscription.stream.listen((event) {
/// print(event);
/// });
///
/// subscription.close();
/// ```
Most of the times it works well, but sometimes (randomly) the connection isn't establish. No exception is thrown when that happens and there is nothing in the logs. This is very frustrating because it breaks functionality.
Does anyone know how to detect if a Realtime connection is properly working from within code?

How to know if Realtime successfully started listening?

Are you using cloudflare?

No, just Appwrite Cloud without having anything in front of it.

Logcat shows this when the connection is working correctly:
I/flutter (17316): subscription: wss://cloud.appwrite.io/v1/realtime?project=xxxxxxxxxxxx&channels%5B%5D=databases.xxxxxxxxxxxxxxx.collections.xxxxxxxxxxxx.documents```
But when it's not working it just shows this:
```I/flutter (17316): AppwriteRealtime: Allow self-signed certificate```

Somewhere it fails to connect, but there is no exception and onDone isn't called either.

I sadly do not know enough using dart, but maybe someone else can help soon 🙂

Did you check here?

Thanks for thinking along either way. 👍🏻

Yeah, there is nothing in the documentation that points me in the right direction. The problem is that it happens completely randomly. And these are the programming problems I hate, because they are hard to debug.
Recommended threads
- I am facing this error: type 'Null' is ...
When attempting to fetch areas from the area collection, the application throws an error: "type 'Null' is not a subtype of type 'int.'" This issue originates in...
- Domain Verification failed
I think i did the step by step well but just not work. When I enter the page I have this error: `Requested host does not match any Subject Alternative Names (S...
- Adding Domain to Sites [Self Hosted]
I am struggling to get this working. I stood-up a new server and deployed appwrite 1.7.4. I added update .env file _APP_DOMAIN=appwrite.mydomain.com _APP_DOMAI...
