New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on 9.0 beta iCloud Syncing #172
Comments
@hank121314 I have confirmed that this is a problem. If I have a |
I made a quick example app to test the syncing: Example app.zip |
I guess this issue is because the value from device A(which is |
Not correct. This issue is because iCloud always accept the new value as the latest value. So you should not send a value that should not be sent. For device A, though true was sent to iCloud. But when B starts, B send false, which is initial to iCloud, so false is the new latest and be sent to A from iCloud. The initial value should never be send. Because without sending it, all device have been already the same as being synced. So it is unnecessary to sync them. Apple knows that, that why all .onChange new API with initial to false as default. On the other hand, Defaults use true as default in legacy, so it may need to change or at least have an option. |
I understand what you mean, but in the internal |
Since it is not need to send the initial value to iCloud at all. Why send it at the first place? Without sending it, you even no need to check the timestamp as iCloud can do all things perfect. Also, as the device B is newly installed, the initial value timestamp will be latest than the iCloud's, so your compare will fail. |
The local timestamp will be updated only when it receives the remote update from iCloud or we change the value in
I agree with this. However, it will require that the Defaults |
Currently I use 8.x with .updates to sync with iCloud manually. However, I find that when syncing with iCloud, it is better to use updates with initial: Bool to false. Or iCloud value will be erased easily by initial value that a new device's newly installed app.
So my question is, is the iCloud Syncing can ignore the initial value by default?
The text was updated successfully, but these errors were encountered: