Skip to content
Back

Realtime error 1008

  • 0
  • Self Hosted
  • Flutter
  • Realtime
Kuromory
25 Jul, 2024, 13:55

I get this error only sometimes and I have no way to catch this... When I create 3 Realtime instances and subscribtions (3 Diffrent Collections) I get this error only sometimes when one of these collection i loaded last (random load order) dunno whats wrong or going on but it would just be helpful to catch this error... else my app crashes... here is the code:

TypeScript
 RealtimeSubscription subscribeToRealtimeUpdates(String collectionId) {
    try {
      print('started subscription to $collectionId');
      var subscription = Realtime(_client).subscribe([
        'databases.$kAppwriteDb.collections.$collectionId.documents',
      ]);
      print('listen to stream');
      subscription.stream.listen((event) {
        if (kDebugMode) {
          print('got event for appwrite: ${event.payload}');
        }
        add(
          RealtimeSubEvent(
            model: fromJsonT(event.payload),
          ),
        );
      }).onError((e) => _logger.severe('realtime error: $e')); // does also not help...
      return subscription;
    } catch (e, s) { // does nothing at all...
      _logger.severe(
        'realtime error DB: $kAppwriteDb; Collection $collectionId;',
        e,
        s,
      );
      rethrow;
    }
  }
TL;DR
Developers are encountering a Realtime error 1008 intermittently and are having trouble catching it in their Dart code when subscribing to Realtime updates. The issue seems to occur randomly when loading one of three different collections last. The developer is looking for help to catch this error to prevent app crashes. The provided code snippet shows the subscription method.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more