
hello guys, i'm updating my Status Story when a user Click to view the Story, the User ID should be added to the array attribute in my DB Collection but this error keep popping out
here is the error output
TypeScript
flutter: Concurrent modification during iteration: _Map len:0.
flutter:
#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)
#10 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#11 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#12 _SyncStream<ā¦>
flutter: ----------------------------------------------------```
TL;DR
Developers are encountering a "Concurrent modification during iteration" error in Flutter when updating a status story in the app. The issue seems to be related to adding user IDs to an array attribute in the database collection. The error message output suggests there is a problem with iterating over a map and modifying it simultaneously. Check the code related to creating sockets and ensure no modifications are being made during iteration. Review and refactor the code to handle array updates without causing concurrent modifications during iteration.
Solution:
- Refactor the code related to creating sockets to ensure no modifications are made during iterations.
here is the Flutter Code ``````
Recommended threads
- Every time I deploy a function via CLI, ...
deploying appwrite function via cli breaks Git connection in function settings tab but when I push to git triggered deployment fail. usually multiple deployment...
- Existing ID bug?!
Idk why this happens can someone explain!! why Im getting this error even if I "manually clear the collection" ?
- A way to configure cloud function config...
Is there a way to configure cloud functions locally and keep that in github and deploy from source control instead of manually configuring it from the console f...
