passepartoutvpn/passepartout-app

iCloud syncing does not work on iOS/macOS

keeshux opened this issue · 4 comments

However, it's reportedly working when sharing profiles with the TV. This can make sense as sync across device/device (Profiles) and device/TV (SharedProfiles) happens in different Core Data stores.

Version from the iPhone App Store. Can confirm that the app does not fetch iCloud profiles after activating the "Sync with iCloud" toggle.

Same behavior with TestFlight. iCloud profiles are not fetched upon clean install.

It could really be as stupid as the fact the iCloud containers have an identifier that Apple doesn't like:

iCloud.com.algoritmico.Passepartout
iCloud.com.algoritmico.Passepartout.Shared

The latter might cause silent problems due to the dot, whereas it's probably safer to use e.g.:

iCloud.com.algoritmico.Passepartout-Shared

This works properly in development, but the identifier issue may only affect production environments (TestFlight included).

error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromPartialError:forStore:inMonitor:](2796): <NSCloudKitMirroringDelegate: 0x2815e0780>: Error recovery failed because the following fatal errors were found: {
    "<CKRecordID: 0x282b932e0; recordName=F209A1B2-1AAE-49B6-891A-556188225282, zoneID=com.apple.coredata.cloudkit.zone:__defaultOwner__>" = "<CKError 0x28242f1e0: \"Invalid Arguments\" (12/2006); server message = \"Cannot create or modify field 'CD_encryptedJSON' in record 'CD_CDProfile' in production schema\"; op = 2EFCD50590D3537B; uuid = 6996B4E5-43D5-45B3-BD44-3B7166A438A8; container ID = \"iCloud.com.algoritmico.Passepartout\">";
}

Got it. The encryptedJSON field was only deployed to the Passepartout.Shared container (i.e. the Apple TV profiles), not to the main Passepartout container (iOS/macOS).

Just deployed the change to production, so apps should now fix themselves without an update.