馃憻 Reproduction steps
- Set up an Appwrite Realtime subscription on a collection/document channel (e.g., messaging).
- Trigger a document creation event (e.g., send a message that creates a document in the subscribed collection).
- The Realtime WebSocket receives the event of type
"event".
- The SDK attempts to parse the incoming event data via
RealtimeMessage.fromMap().
- The app crashes with an unhandled exception.
馃憤 Expected behavior
The RealtimeMessage.fromMap() factory constructor should correctly parse the incoming WebSocket event data regardless of whether the server sends events or channels as a List or a Map. The Realtime subscription callback should fire with a valid RealtimeMessage object containing the event payload.
馃憥 Actual Behavior
E/flutter (16642): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type '_Map<String, dynamic>' is not a subtype of type 'Iterable<dynamic>'
E/flutter (16642): #0 new RealtimeMessage.fromMap (package:appwrite/src/realtime_message.dart:57:47)
E/flutter (16642): #1 RealtimeMixin._createSocket.<anonymous closure> (package:appwrite/src/realtime_mixin.dart:100:45)
E/flutter (16642): #2 _RootZone.runUnaryGuarded (dart:async/zone.dart:1778:10)
...
馃幉 Appwrite version
Version 2.0.x
馃捇 Operating system
Windows
馃П Your Environment
Flutter app using BLoC pattern for state management
Appwrite Realtime subscriptions on tablesdb/tables channels
Standard Appwrite Cloud
馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?
馃憻 Reproduction steps
"event".RealtimeMessage.fromMap().馃憤 Expected behavior
The
RealtimeMessage.fromMap()factory constructor should correctly parse the incoming WebSocket event data regardless of whether the server sendseventsorchannelsas aListor aMap. The Realtime subscription callback should fire with a validRealtimeMessageobject containing the event payload.馃憥 Actual Behavior
馃幉 Appwrite version
Version 2.0.x
馃捇 Operating system
Windows
馃П Your Environment
Flutter app using BLoC pattern for state management
Appwrite Realtime subscriptions on tablesdb/tables channels
Standard Appwrite Cloud
馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?