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
- Database error validating 'min' and 'max...
I keep seeing an error when I try to add a column to a database table within the AppWrite cloud UI. I also see this error when trying to create or update a reco...
- Fine grained permissions for webRTC hand...
Hi, I am building a WebRTC P2P app for a university project and have hit a security limitation regarding permissions for anonymous users. The Architecture: We ...
- Synchronous Function Execution Timed Out...
Hi Appwrite team 👋 I’m facing a synchronous function execution timeout issue on Appwrite Cloud and would appreciate some guidance. I executed this function u...