Back

Not familiar with this issue, connected with Websocket/Realtime in databases

  • 0
  • Databases
  • Flutter
  • Realtime
Mosh Ontong
3 Mar, 2024, 10:01
TypeScript
 @override
  Stream<SubscribeRealtime<User>> streamUsers({required Realtime realtime}) {
    _logger.info('Subscribing to user stream');
    final subscription = realtime.subscribe(
      [
        // ignore: lines_longer_than_80_chars
        'databases.${userCredential.databaseId}.collections.${userCredential.collectionId}.documents',
      ],
    );

    return subscription.stream.map((event) {
      return SubscribeRealtime(
        data: User.fromJson(
          event.payload,
        ),
        type: SubscribeRealtimeType.fromString(
          event.events.first,
        ),
      );
    });
  }
TL;DR
Developers are experiencing an issue with Websocket/Realtime in databases that is new and was not occurring before. The provided code snippet shows how they are handling subscription to user streams. Solution: The error could potentially be related to the way the subscription to the realtime data is being handled in the code snippet. Double-check the implementation and ensure it aligns with the requirements for Websocket/Realtime in databases.
D5
3 Mar, 2024, 10:46

What's your code?

D5
3 Mar, 2024, 10:46

This is cloud, right?

Mosh Ontong
3 Mar, 2024, 10:54

yup

Mosh Ontong
3 Mar, 2024, 10:54

I already posted the code

Mosh Ontong
3 Mar, 2024, 10:55

This is new to me, in recent month. This is error does not occur before.

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