From e8b5411efbcc56648d00f39b2b0db086be8aa101 Mon Sep 17 00:00:00 2001 From: Camden King Date: Thu, 5 Jun 2025 14:55:09 -0700 Subject: [PATCH 1/2] attempt migration once --- GoogleSignIn/Sources/GIDAuthStateMigration.m | 8 -------- 1 file changed, 8 deletions(-) diff --git a/GoogleSignIn/Sources/GIDAuthStateMigration.m b/GoogleSignIn/Sources/GIDAuthStateMigration.m index 4df01d11..0ccd979a 100644 --- a/GoogleSignIn/Sources/GIDAuthStateMigration.m +++ b/GoogleSignIn/Sources/GIDAuthStateMigration.m @@ -107,10 +107,6 @@ - (void)performDataProtectedMigrationIfNeeded { if (authSession) { NSError *err; [self.keychainStore saveAuthSession:authSession error:&err]; - // If we're unable to save to the keychain, return without marking migration performed. - if (err) { - return; - }; [keychainStoreLegacy removeAuthSessionWithError:nil]; } @@ -138,10 +134,6 @@ - (void)performGIDMigrationIfNeededWithTokenURL:(NSURL *)tokenURL if (authSession) { NSError *err; [self.keychainStore saveAuthSession:authSession error:&err]; - // If we're unable to save to the keychain, return without marking migration performed. - if (err) { - return; - }; } // Mark the migration check as having been performed. From ea26eea804a2a89b5ea1ac0a5f726a999a362899 Mon Sep 17 00:00:00 2001 From: Camden King Date: Fri, 6 Jun 2025 10:45:39 -0700 Subject: [PATCH 2/2] update test --- GoogleSignIn/Tests/Unit/GIDAuthStateMigrationTest.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GoogleSignIn/Tests/Unit/GIDAuthStateMigrationTest.m b/GoogleSignIn/Tests/Unit/GIDAuthStateMigrationTest.m index 6379fb4f..1a482657 100644 --- a/GoogleSignIn/Tests/Unit/GIDAuthStateMigrationTest.m +++ b/GoogleSignIn/Tests/Unit/GIDAuthStateMigrationTest.m @@ -181,7 +181,7 @@ - (void)testMigrateIfNeeded_KeychainFailure_DataProtectedMigration { callbackPath:kCallbackPath keychainName:kKeychainName isFreshInstall:NO]; - XCTAssertNotNil([_realLegacyGTMKeychainStore retrieveAuthSessionWithError:nil]); + XCTAssertNil([_realLegacyGTMKeychainStore retrieveAuthSessionWithError:nil]); } #else