gojek / courier-iOS

Courier iOS
38 stars 15 forks source link

Fix - nil is not a legal NSPersistentStoreCoordinator for searching for entity name #10

Closed alfianlosari closed 2 years ago

alfianlosari commented 2 years ago

This MR fixes the issue for a rare crash "nil is not a legal NSPersistentStoreCoordinator for searching for entity name" by making MQTTPersistent utilize a single instance instead of recreating when connection options changes.

It also provides flag to initialize the ManagedObjectContext immediately at the time of Courier Initialization to avoid any future race condition issue