CardinalKit icon indicating copy to clipboard operation
CardinalKit copied to clipboard

CoreData throws exception when withdrawing and trying to log in again

Open vishnuravi opened this issue 3 years ago • 1 comments

Describe the bug When withdrawing from the study and attempting to log in again, Core Data throws an exception and the app crashes.

CoreData: error: Illegal attempt to save to a file that was never opened. "This NSPersistentStoreCoordinator has no persistent stores (unknown)

To Reproduce Steps to reproduce the behavior:

  1. Log in to CardinalKit
  2. Choose "Withdraw from Study" on the "Profile" tab and confirm your withdrawal on the following screen.
  3. Once returns to the login screen, choose "Login Existing User" and log in.

Expected behavior The app should not crash.

Screenshots N/A

Smartphone (please complete the following information):

  • Device: Simulator
  • OS: iOS 15.5

Additional context This does not occur if the app is deleted and reinstalled after withdrawing.

vishnuravi avatar Jul 08 '22 15:07 vishnuravi

This issue appears to be originating from CKCareKitManager.shared.wipe() which is called upon opting to withdraw.

vishnuravi avatar Aug 04 '22 03:08 vishnuravi