Back

Flutter Realtime: Concurrent Modification during iteration

  • 0
  • Flutter
  • Realtime
Mosh Ontong
29 Apr, 2024, 01:26
TypeScript
#0  _CompactIterator.moveNext (dart:collection-patch/compact_hash.dart:714:7)
#1  RealtimeMixin._createSocket.<anonymous closure> (package:appwrite/src/realtime_mixin.dart:91:49)
#2  _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#3  _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
#4  _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#5  _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#6  _ForwardingStream._handleDone (dart:async/stream_pipe.dart:99:10)
#7  _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:161:13)
#8      _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#9      _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
TL;DR
Developers are experiencing a Concurrent Modification error while using the latest Appwrite Flutter SDK for Realtime. The issue is occurring during socket creation and stream handling, resulting in errors related to stream subscription and WebSocket closure. The error likely stems from iteration conflicts in the code, possibly in the RealtimeMixin file. Solution: Review the RealtimeMixin.dart file around line 91 to ensure proper handling of stream iteration and modifications during socket creation. Consider restructuring the code to prevent concurrent modifications during iteration to resolve the issue.
Mosh Ontong
29 Apr, 2024, 01:26
TypeScript
#10     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#11     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#12     _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:792:19)
#13     _StreamController._closeUnchecked (dart:async/stream_controller.dart:647:7)
#14     _StreamController.close (dart:async/stream_controller.dart:640:5)
#15     new _WebSocketImpl._fromSocket.<anonymous closure> (dart:_http/websocket_impl.dart:1171:19)
#16     _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#17     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
#18     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#19     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#20     _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
#21     _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
#22     _WebSocketProtocolTransformer.close (dart:_http/websocket_impl.dart:118:17)
Mosh Ontong
29 Apr, 2024, 01:26
TypeScript
#23     _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
#24     _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#25     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
#26     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#27     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#28     _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:792:19)
#29     _StreamController._closeUnchecked (dart:async/stream_controller.dart:647:7)
#30     _StreamController.close (dart:async/stream_controller.dart:640:5)
#31     _Socket._onData (dart:io-patch/socket_patch.dart:2454:21)
#32     _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#33     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#34     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#35     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#36     _StreamController._add (dart:async/stream_controller.dart:658:7)
#37     _StreamController.add (dart:async/stream_controller.dart:606:5)
#38     _RawSecureSocket._closeHandler (dart:io/secure_socket.dart:899:21)
#39     _RawSecureSocket._tryFilter (dart:io/secure_socket.dart:1029:11)<asynchronous suspension>
Mosh Ontong
29 Apr, 2024, 01:27

For more information: I am using the latest sdk of appwrite flutter

Mosh Ontong
29 Apr, 2024, 01:28
TypeScript
#1  RealtimeMixin._createSocket.<anonymous closure> (package:appwrite/src/realtime_mixin.dart:91:49)
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