Skip to content

feat: add shared keychain support for device UUIDs#45

Open
edusperoni wants to merge 1 commit into
fabiocaccamo:masterfrom
edusperoni:feat/sharedkeychain
Open

feat: add shared keychain support for device UUIDs#45
edusperoni wants to merge 1 commit into
fabiocaccamo:masterfrom
edusperoni:feat/sharedkeychain

Conversation

@edusperoni

Copy link
Copy Markdown

No description provided.

Comment thread FCUUID/FCUUID.m
_uuidForDeviceShared = [NSString stringWithString:value];
[self _setValue:_uuidForDeviceShared forKey:_uuidForDeviceSharedKey userDefaults:NO keychain:YES service:_uuidForDeviceSharedService accessGroup:_sharedAccessGroup synchronizable:NO];

return _uuidForDeviceShared;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method validates value before checking if a shared UUID already exists.

This conflicts with the intended behavior (“if shared UUID already exists, return it unchanged”).

If callers run migration unconditionally and pass nil/invalid input while a shared UUID already exists, this will throw unexpectedly.

Should check existingSharedDeviceUUID first, and only validate value when creating a new shared UUID.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I have a few other adjustments that I made. I'll update the PR. One thing I noticed is that we don't restrict the key to "this device only" so backups and restores on a different device duplicate the id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants