Skip to content

Delete the deprecated KeychainUtils class - #26472

Merged
crazytonyli merged 1 commit into
trunkfrom
task/delete-deprecated-keychain-utils
Dec 1, 2026
Merged

crazytonyli merged 1 commit into
trunkfrom
task/delete-deprecated-keychain-utils

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

AppKeychain and SharedKeychain replaced the production callers in #25654. The last copyKeychain caller was removed in #25306. Repository-wide searches found no remaining callers of the deprecated class, including Objective-C callers.

Remove the unused class and its dedicated test. Keychain storage and migration behavior are unchanged. No release note is needed because there is no user-visible change.

What I ran

  • I built this change and ran the affected tests locally

Codex verified on an iPhone 18 Pro simulator running iOS 27.2:

  • WordPress and Jetpack builds passed with ad hoc signing.

  • The full WordPressSharedTests target passed through WordPressUnitTests, including AppKeychainTests and SharedKeychainTests:

    Test run with 224 tests in 50 suites passed after 1.711 seconds.
    
  • Jetpack signed in with the test account and stayed signed in after termination and relaunch without credentials.

Testing instructions

Run WordPressSharedTests through the WordPressUnitTests plan. Sign in to Jetpack, terminate it, and relaunch without sign-in arguments. Confirm the account stays signed in.

@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@crazytonyli
crazytonyli requested a review from jkmassel December 1, 2026 21:08
@crazytonyli crazytonyli added this to the 27.6 milestone Dec 1, 2026
@crazytonyli
crazytonyli marked this pull request as ready for review December 1, 2026 21:09

@wpmobilebot wpmobilebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve. This deletes the deprecated KeychainUtils class and its only test. Nothing in the repo still uses it. I searched Swift, Objective-C, headers, .pbxproj, test plans, and YAML/JSON files, and found no references to KeychainUtils or copyKeychain. The history matches the description: #25654 moved the production callers to AppKeychain/SharedKeychain, and #25306 removed the last copyKeychain call. WordPressShared still needs SFHFKeychainUtils because AppKeychain and SharedKeychain import it. The deleted test only covered copyKeychain, which is also gone, so no remaining code loses coverage.

Validation on 1a9aab3b59, iPhone 18 Pro simulator, iOS 27.2 (Xcode 27.2):

  • WordPressUnitTests plan, filtered to WordPressSharedTests plus WordPressTest/DataMigratorTests, SharedDataIssueSolverTests, and KeychainTest. Result: Test run with 224 tests in 50 suites passed and Executed 21 tests, with 0 failures.
  • The Jetpack Debug build succeeded. I signed in with the test account using -wpcom-token, terminated the app, and relaunched it without arguments. It opened on My Site, still signed in.

Gaps: I had no a8c-secrets key, so I built with a local-only change that lets the Decrypt Secrets phase continue when decryption fails. That phase isn't related to this change. I didn't test a fresh-install keychain migration, because this PR doesn't change any migration code. CI's build and unit-test jobs were still pending when I submitted this review.

Optional follow-ups, both in files this PR doesn't touch:

  • Nit: +[SFHFKeychainUtils getAllPasswordsForAccessGroup:] (Modules/Sources/SFHFKeychainUtils/include/SFHFKeychainUtils.h:68) has no callers once copyKeychain is gone, so it can be deleted.
  • Nit: KeychainUtilsMock (Tests/KeystoneTests/Tests/Jetpack/KeychainUtilsMock.swift) is still named after the class this PR deletes. It mocks KeychainAccessible, so a name like KeychainAccessibleMock would point readers to a type that exists.

@crazytonyli
crazytonyli added this pull request to the merge queue Dec 1, 2026
Merged via the queue into trunk with commit 0a68507 Dec 1, 2026
24 checks passed
@crazytonyli
crazytonyli deleted the task/delete-deprecated-keychain-utils branch December 1, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants