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
- Migration and Function glitch
I am trying to migrate from non pro appwrite project to pro appwrite project all my data but it's stuck in processing.
- Unable to signup to appwrite cloud
When attempting to create an online cloud account on appwrite.io, I get the following message : "This email address must already be in its canonical form. Pleas...
- Email address must be in its canonical f...
Hello, Recently I was trying to signup with my GitHub account with appwrite account for availing the student benifits but while trying to signup I saw such erro...