Skip to content

fix(ios): evaluate cloudSync boolean value instead of pointer truthiness - #796

Open
kewdex wants to merge 1 commit into
oblador:masterfrom
kewdex:kewde/fix-cloud-sync
Open

kewdex wants to merge 1 commit into
oblador:masterfrom
kewdex:kewde/fix-cloud-sync

Conversation

@kewdex

@kewdex kewdex commented May 8, 2026

Copy link
Copy Markdown

Summary

  • Fixes bug where cloudSync: false was incorrectly treated as true
  • In Objective-C, @NO is a non-nil NSNumber object that evaluates as truthy in pointer checks
  • This could cause secrets to sync to iCloud even when the caller explicitly disabled cloud sync

Test plan

  • Call setGenericPassword with { cloudSync: false } and verify item is stored with kSecAttrSynchronizable = false
  • Call setGenericPassword with { cloudSync: true } and verify item is stored with kSecAttrSynchronizable = true
  • Call setGenericPassword without cloudSync option and verify default behavior (no sync)

In Objective-C, @no is a non-nil NSNumber object that evaluates as
truthy in pointer checks. This caused cloudSync: false to be treated
as true, potentially syncing secrets to iCloud when explicitly disabled.
@kewdex

kewdex commented May 8, 2026

Copy link
Copy Markdown
Author

cc @joshua-rogers-exodus

@joshua-rogers-exodus

Copy link
Copy Markdown

lgtm

This branch has not been deployed

No deployments
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