drewmccormack / ensembles

A synchronization framework for Core Data.
MIT License
1.63k stars 132 forks source link

Force rebase? #256

Closed susiej closed 7 years ago

susiej commented 7 years ago

Hi, is it possible to force the cloud copy to rebase to what is on my laptop (macos version)? I've stuffed something up and now my merges log the error: [_NSFaultingMutableSet array]: unrecognized selector sent to instance 0x600000433a00 The merge returns nil error, but it seems to prevent it from completing successfully as the changes aren't propagating. If I have to, I can deleech the ios versions, but I didn't want to loose all my data completely.

Or should I just rename the ensemble store and let it copy itself to a new version? If I did that, what is the best way to wipe the old data so I don't have it lying around?

Thanks, Susie

drewmccormack commented 7 years ago

Hi Susie, There is a class method on CDEPersistentStoreEnsemble that removes data for an ensemble. +removeEnsemble... If I understand correctly, your local data is right, and the cloud is wrong. In that case, deleech, then call the above method, then leech again. Kind regards, Drew

On 5 Jun 2017, at 09:21, Susie Johnston notifications@github.com wrote:

Hi, is it possible to force the cloud copy to rebase to what is on my laptop (macos version)? I've stuffed something up and now my merges log the error: [_NSFaultingMutableSet array]: unrecognized selector sent to instance 0x600000433a00 The merge returns nil error, but it seems to prevent it from completing successfully as the changes aren't propagating. If I have to, I can deleech the ios versions, but I didn't want to loose all my data completely.

Or should I just rename the ensemble store and let it copy itself to a new version? If I did that, what is the best way to wipe the old data so I don't have it lying around?

Thanks, Susie

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

susiej commented 7 years ago

Finally have it working again! Thanks :) It took a nearly week of fiddling around to get it up and running. (Well, in my spare time which isn't that much when I had a work project due on Thursday and have two kids :P). One of my objects had somehow lost it's uniqueid and it was failing silently. And I discovered that if you use sqlite3 to add the id back in, if the .sqlite-wal file still has data in it the update you make disappears, so you think it's updated, then re-run the program, and the uniqueid disappears again as sqlite/coredata overwrites it sigh

drewmccormack commented 7 years ago

It is important that Ensembles open the SQLite in the same mode as you are opening it. If you set custom options for your store, pass those same options to Ensembles via the property persistentStoreOptions. Don’t know if that could have caused this, but worth considering.

Drew

On 11 Jun 2017, at 03:43, Susie Johnston notifications@github.com wrote:

Finally have it working again! Thanks :) It took a nearly week of fiddling around to get it up and running. (Well, in my spare time which isn't that much when I had a work project due on Thursday and have two kids :P). One of my objects had somehow lost it's uniqueid and it was failing silently. And I discovered that if you use sqlite3 to add the id back in, if the .sqlite-wal file still has data in it the update you make disappears, so you think it's updated, then re-run the program, and the uniqueid disappears again as sqlite/coredata overwrites it sigh

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/drewmccormack/ensembles/issues/256#issuecomment-307600552, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEuAJcr3aBBL1QtyiU1WeSplUMPjtZGks5sC0YlgaJpZM4NwQwa.