Start a new topic

Offline saving throwing errors

When my app comes online with a non-empty persistent queue, I get the following error :



'Collection was mutated while being enumerated'



Thread view:

```Thread 16, Queue : com.apple.root.background-priority

0 0x3c1f1350 in __pthread_kill ()

1 0x3c167fb6 in pthread_kill ()

2 0x3c1a436a in abort ()

3 0x3b74cdde in abort_message ()

4 0x3b74a098 in default_terminate() ()

5 0x3bcfda5a in _objc_terminate() ()

6 0x3b74a11a in safe_handler_caller(void (*)()) ()

7 0x3b74a1b4 in std::terminate() ()

8 0x3b74b59e in __cxa_throw ()

9 0x3bcfd9a2 in objc_exception_throw ()

10 0x33e72ec0 in __NSFastEnumerationMutationHandler ()

11 0x00225796 in -[KCSSaveQueue encodeWithCoder:] at /Users/mike/work/ios-library/tags/1.17.3/KinveyKit/KinveyKit/Source/KCSSaveQueue.m:278

12 0x346ecdb6 in _encodeObject ()

13 0x346ee286 in -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] ()

14 0x34728180 in -[NSDictionary(NSDictionary) encodeWithCoder:] ()

15 0x346ecdb6 in _encodeObject ()

16 0x00224988 in -[KCSSaveQueues persistQueues] at /Users/mike/work/ios-library/tags/1.17.3/KinveyKit/KinveyKit/Source/KCSSaveQueue.m:139

17 0x3c117792 in _dispatch_call_block_and_release ()

18 0x3c11b656 in _dispatch_root_queue_drain ()

19 0x3c11b7d8 in _dispatch_worker_thread2 ()

20 0x3c13f7f0 in _pthread_wqthread ()

21 0x3c13f684 in start_wqthread ()```



variable view:

```self KCSSaveQueues * 0x1cd9fa60 0x1cd9fa60

NSObject NSObject

_queues __NSDictionaryM * 3 key/value pairs 0x1d880f20

[0] (null) @"events_list" : (no summary)

key __NSCFString * @"cards_list" 0x1d882d20

value KCSSaveQueue * 0x1d882500 0x1d882500

[1] (null) @"" : (no summary)

key __NSCFString * @"" 0x1d882d40

value KCSSaveQueue * 0x1d8827b0 0x1d8827b0

[2] (null) @"" : (no summary)

key __NSCFString * @"" 0x1d882d70

value KCSSaveQueue * 0x1d882bd0 0x1d882bd0```



Any pointers?

Hi Igor,

This seems like it may be a threading issue. What is the use case?
Caroline,

my app saves some records while offline, I can see them in KCSSaveQueue. When I go online, queue processing starts and then the above.
Login or Signup to post a comment