Back

Realtime Flutter SDK exception: Concurrent modification during iteration: _Map len:0.

  • 0
  • Flutter
  • Realtime
memoonlite
23 May, 2024, 08:04

Hello everyone! I'd like to report a problem regarding the Realtime SDK on Flutter. Sometimes, but not always, an exception is thrown by the Realtime SDK after connecting:

TypeScript
E/flutter ( 4989): #0      _CompactIterator.moveNext (dart:collection-patch/compact_hash.dart:714:7)
E/flutter ( 4989): #1      RealtimeMixin._createSocket.<anonymous closure> (package:appwrite/src/realtime_mixin.dart:91:49)
E/flutter ( 4989): #2      _RootZone.runGuarded (dart:async/zone.dart:1582:10)
E/flutter ( 4989): #3      _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
E/flutter ( 4989): #4      _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
E/flutter ( 4989): #5      _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
E/flutter ( 4989): #6      _ForwardingStream._handleDone (dart:async/stream_pipe.dart:99:10)
E/flutter ( 4989): #7      _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:161:13)
E/flutter ( 4989): #8      _RootZone.runGuarded (dart:async/zone.dart:1582:10)
E/flutter ( 4989): #9      _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
E/flutter ( 4989): #10     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)

(Exception continues in message below this post, because of Discord stupid message limit)

I'm using version 12.0.3 of the Appwrite SDK. Does anyone know what could cause this problem?

TL;DR
Developers are encountering a Concurrent modification during iteration error with the Realtime SDK on Flutter. The issue seems to arise inconsistently after connecting, with stack traces indicating modification during iteration. This problem has been noted using Appwrite SDK version 12.0.3. No specific solutions were provided in the thread.
memoonlite
23 May, 2024, 08:04

Exception continues:

TypeScript
E/flutter ( 4989): #12     _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:792:19)
E/flutter ( 4989): #13     _StreamController._closeUnchecked (dart:async/stream_controller.dart:647:7)
E/flutter ( 4989): #14     _StreamController.close (dart:async/stream_controller.dart:640:5)
E/flutter ( 4989): #15     new _WebSocketImpl._fromSocket.<anonymous closure> (dart:_http/websocket_impl.dart:1156:19)
E/flutter ( 4989): #16     _RootZone.runBinaryGuarded (dart:async/zone.dart:1606:10)
E/flutter ( 4989): #17     _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:358:15)
E/flutter ( 4989): #18     _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373:9)
E/flutter ( 4989): #19     _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:280:7)
E/flutter ( 4989): #20     _SinkTransformerStreamSubscription._addError (dart:async/stream_transformers.dart:75:11)
E/flutter ( 4989): #21     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:113:7)
E/flutter ( 4989): #22     _HttpDetachedStreamSubscription._maybeScheduleData.<anonymous closure> (dart:_http/http_parser.dart:173:20)
E/flutter ( 4989): #23     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter ( 4989): #24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
E/flutter ( 4989): ```
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