Skip keychain migration for DEV/staging builds
Merged
LA
8mo ago+9+9+0123456789-1-1-0123456789
Summary
- Skip
migrateLegacyKeychainPasswordIfNeededfor debug and staging bundle IDs - Each tagged DEV build gets a unique bundle ID (
com.cmuxterm.app.debug.<tag>) with its own UserDefaults domain, so the migration version key is never set and migration runs on every launch - The
SecItemCopyMatchingcall triggers a macOS keychain access prompt because the ad-hoc re-signed binary doesn't match the ACL on the legacy keychain item
Root cause
reload.sh --tag Xbuilds with Xcode, copies the.app, modifies Info.plist to set a unique bundle ID- Re-signs with
codesign --force --sign -(ad-hoc) - On launch, fresh UserDefaults domain means migration guard (
keychainMigrationVersion) is unset SecItemCopyMatchingis called for legacy keychain servicecom.cmuxterm.app.socket-control- macOS prompts because the ad-hoc signature doesn't match the keychain item's ACL
Fix
Guard the migration call in cmuxApp.init() using the existing isDebugLikeBundleIdentifier / isStagingBundleIdentifier helpers. DEV/staging builds never have legitimate legacy keychain passwords to migrate.
Testing
- Build succeeds (
xcodebuild -scheme cmux -configuration Debug) - Tagged DEV builds should no longer prompt for keychain access on launch
Summary by cubic
Skip legacy keychain password migration for DEV and staging builds to stop macOS keychain prompts on tagged DEV launches. Migration now runs only for production bundle IDs.
- Bug Fixes
- Guarded migrateLegacyKeychainPasswordIfNeeded in cmuxApp.init() using isDebugLikeBundleIdentifier and isStagingBundleIdentifier.
Summary by CodeRabbit
- Bug Fixes
- Improved keychain authentication handling to reduce unnecessary system prompts
- Fixed legacy password migration behavior to prevent authentication dialogs on development builds