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
Issue when changing multiple keys in macOS Monterey #53
Comments
Thanks for the callout. If this is in a beta build, I'd wait it out. I don't know how to fix it either. If this turns out to be a massive problem then I'll spend some time thinking on it. Let me know what you see in newer betas. |
Forgot to mention: I also filled a radar. I can put it on Open Radar as well. |
That sounds like a great idea! |
Closing for now - please reopen if you still see this issue. |
Issue is still existent on Monterey 12.0.1 as well as 12.1 Beta 1. I would recommend reopening this. The library does not work in this form on Monterey unfortunately :-/ |
I confirmed that |
Mind opening a new ticket? I'm ooto for a few more days. Will take it from there. Most likely will stop support macOS since I don't have time to really address this issue. Arthur |
First off: Thank you for this library. This is exactly what I was looking for.
There seems to be a sync issue with macOS Monterey (tested version: 12.0.1 (21A558))
It seems that Apple changed the behavior on how it posts the
NSUbiquitousKeyValueStore.didChangeExternallyNotification
notification.Formerly,
notification.userInfo?[NSUbiquitousKeyValueStoreChangedKeysKey]
contained ALL changed keys (includingZephyrSyncKey
). In my tests, this is no longer the case. Instead, the notification gets posted multiple times, with different values. Here is what happens in my scenario:We have Client A and Client B. Lets say A changes 2 keys. What happens is:
Zephyr:
NSUbiquitousKeyValueStore.didChangeExternallyNotification
notification for key 1, stores remote value to local user defaults.NSUbiquitousKeyValueStore.didChangeExternallyNotification
notification for key 2, throws it away, because local sync date is newerNSUbiquitousKeyValueStore.didChangeExternallyNotification
notification for keyZephyrSyncKey
Zephyr/Sources/Zephyr.swift
Lines 456 to 459 in d86fe8c
In this scenario, the second value was thrown out and both apps are no longer in sync.
I can't tell if this is a (beta) bug or if this is the new, expected behavior. I can't think of a good way to fix this, as we would now need to store the sync date of each property - or somehow batch all those updates coming in.
The text was updated successfully, but these errors were encountered: