Suggestions for things to address in documentation #100
Replies: 2 comments 6 replies
-
Hi @dave256, thanks for this detailed list of things that need to be fixed/thought about more deeply. I can respond to a few things here, and then for a bunch of this I will create tasks for us in our internal tracker.
We are still refining this, but right now the rule is basically: for a new table, you do not need to provide defaults for anything if you don't want. For alterations to tables, you do need to provide defaults, or make the column nullable. This is just forced on us since adding a column will leave many rows with no data for that column, and something has to be done about that.
Fair enough, can clarify!
Associations are shared in CloudKit via the For plain synchronization (no sharing) the
Yes, if an app is already deployed to the App Store with no sync, and an update is released that adds sync, we will upload all records currently on the device to CloudKit
This should also be possible. As soon as a
We haven't thought about this situation in particular much, but it should be possible. We have an internal
Nothing like that right now. Is this only in the context of debugging? Or is there a use case for this in production?
As long as when you "play back" the dump file by using the
Similar to above, as long as you are using the
I believe this would be handled gracefully. The scenario is:
In this situation, the database restored at time=2 (which is the version of the database from time=0 due to the backup) would have its |
Beta Was this translation helpful? Give feedback.
-
@dave256 We've added preliminary support for stopping and starting a sync engine here: https://github.com/pointfreeco/sharing-grdb/pull/142
There are likely more things to test, but if you'd like to point your app to that branch you can hopefully get your feet wet! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I realize the documentation is in the very early stages but here are some questions I have and think may be worth addressing as others may have the same/similar questions:
CloudKit.md
Designing your schema with synchronization in mind
id
column may never be used in your application code, but it is necessary to facilitate synchronizing to CloudKit." can be interpreted multiple ways. I'm fairly certain by "may never be used" you mean "might not be needed" but it could also be interpreted as you shouldn't use it for anything in your app.Record Conflicts
I look forward to reading the other sections - especially how to write unit tests for this
I assume the updating triggers comments will be expanded
CloudKitSharing.md
Other questions
is it possible to turn on syncing after data has already been added to the SQLite database? if so what precautions or issues do you need to handle? possible scenarios for this:
is it possible to turn off syncing after data has already been added? if so, is the data in CloudKit deleted? possible scenarios for this:
if the data in CloudKit seems corrupted (or syncing doesn't seem to be working) is there a way (an API) so the the app could have a button the user could tap to delete the data in CloudKit and then start over with the existing data in the SQLite database?
a feature I'm thinking about building into my app is the ability to backup/export part of the database and then later allow it to be imported. For example before Sharing a root record, they back it up (perhaps some sort of SQLite dump file they could email to themselves, Save to Files app, etc.) that way if the person they shared it with corrupts the shared record (deletes data, etc.) they could restore from their backup. I'm assuming the way to restore it would be to delete the shared root record and then import the data back from the SQLite dump file. I'm guessing that wouldn't cause any issues with syncing, but didn't know if "playing back" the dump file (I need to look at what options there are for doing this) would cause problems with the sync engine. this feature could also be useful for exporting/archiving old data that isn't likely needed again but then later they do want to restore the data.
what happens if the app allows the user to copy/export the entire SQLite file (again email, save to Files), makes changes in the app that updates the SQLite file, and then later wants to restore that SQLite file back to before those changes via the export SQLite file. are there any sync related issues with that?
could a similar issue happen if the user has backed up their iPhone/iPad to iCloud, makes changes to the SQLite file via app interactions, then loses/breaks their phone before another iCloud backup is done, gets a new phone and restores from the iCloud backup? would the newer data stored in CloudKit sync properly over older SQLite file that was in the iCloud backup or would CloudKit think that data had been deleted since its now not in the SQLite file that was restored and delete it from other devices (such as an iPad)?
Beta Was this translation helpful? Give feedback.
All reactions