mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 21:22:53 +00:00
Seventh review pass. No correctness findings this round; both are availability. The retry budget was only reset inside the tokenless branch of an identity change, so an account that exhausted its four attempts left the next one with none - its queued resolve() did no lookup at all and credentials stayed unavailable until another foreground transition. The budget belongs to the identity being resolved, so it now resets on every observed change. ubiquityIdentityToken was archived with requiringSecureCoding: true, but Foundation guarantees only NSCoding for it. Measured: a class adopting only NSCoding does throw under secure archiving, and the `try?` there would have silently produced no fingerprint - losing the scope cache, forcing a CloudKit lookup every launch and leaving credentials unavailable offline. This Mac's token happens to support secure coding, so nothing was failing yet; the archive is only ever hashed, never decoded, so secure coding buys nothing regardless. Also measured: the non-secure archive is deterministic, which is what the fingerprint comparison depends on. Note the digest differs between the two archiving modes, so any scope cached before this change resolves once more against CloudKit and re-caches.