Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode old fcmToken format #12246

Merged
merged 5 commits into from
Jan 6, 2024
Merged

Decode old fcmToken format #12246

merged 5 commits into from
Jan 6, 2024

Conversation

paulb777
Copy link
Member

@paulb777 paulb777 commented Jan 5, 2024

Fix #12245.

If decoding of the FIRMessagingTokenInfo fails, fallback to the pre-10.19.0 code and migrate the keychain to the NSSecure encode.

Summary from @ncooke3:

  1. developer onboards to 10.20.0+ → secure tokens are always read and written
  2. developer updates to 10.20.0+ from 10.18.0 or below → initial read of an unsecure token, write back a secured token, and always read secure tokens afterwards
  3. developer updates to 10.20.0+ from 10.19.0 → two subcases:
    a. the unsecure token was overwritten by the secure token & always read later as a secure token
    b. the unsecure token was NOT overwritten yet and the fallback decode code path kicks into effect

@google-oss-bot
Copy link

google-oss-bot commented Jan 5, 2024

Size Report 1

Affected Products

  • FirebaseMessaging

    TypeBase (0fa8498)Merge (5fb94a6)Diff
    CocoaPods?-51.5 kB? (?)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/x3g0bwjjR6.html

@google-oss-bot
Copy link

google-oss-bot commented Jan 5, 2024

Coverage Report 1

Affected Products

  • FirebaseMessaging-iOS-FirebaseMessaging.framework

    Overall coverage changed from ? (0fa8498) to 60.16% (5fb94a6) by ?.

    29 individual files with coverage change

    FilenameBase (0fa8498)Merge (5fb94a6)Diff
    FIRMessaging.m?55.20%?
    FIRMessagingAnalytics.m?82.14%?
    FIRMessagingAPNSInfo.m?87.76%?
    FIRMessagingAuthKeychain.m?87.42%?
    FIRMessagingAuthService.m?92.03%?
    FIRMessagingBackupExcludedPlist.m?82.09%?
    FIRMessagingCheckinPreferences.m?98.02%?
    FIRMessagingCheckinService.m?86.49%?
    FIRMessagingCheckinStore.m?81.68%?
    FIRMessagingContextManagerService.m?85.71%?
    FIRMessagingExtensionHelper.m?77.92%?
    FIRMessagingKeychain.m?93.39%?
    FIRMessagingLogger.m?100.00%?
    FIRMessagingPendingTopicsList.m?89.02%?
    FIRMessagingPersistentSyncMessage.m?38.10%?
    FIRMessagingPubSub.m?52.14%?
    FIRMessagingRemoteNotificationsProxy.m?76.35%?
    FIRMessagingRmqManager.m?57.42%?
    FIRMessagingSyncMessageManager.m?68.89%?
    FIRMessagingTokenDeleteOperation.m?0.00%?
    FIRMessagingTokenFetchOperation.m?75.91%?
    FIRMessagingTokenInfo.m?66.92%?
    FIRMessagingTokenManager.m?14.82%?
    FIRMessagingTokenOperation.m?95.04%?
    FIRMessagingTokenStore.m?53.17%?
    FIRMessagingTopicOperation.m?0.00%?
    FIRMessagingUtilities.m?56.73%?
    NSDictionary+FIRMessaging.m?27.27%?
    NSError+FIRMessaging.m?100.00%?

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/YRK16Jxf2E.html

Copy link
Member

@ncooke3 ncooke3 left a comment

Choose a reason for hiding this comment

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

It would be better to fix the token in the keychain.

Agreed, but so far I can't think of such a way. My thinking is that in order to fix the token in the keychain, we'd have to read from it to know what it is, which leads back to the current decoding issue.

@paulb777 paulb777 marked this pull request as ready for review January 5, 2024 22:13
@paulb777 paulb777 merged commit 75f5282 into main Jan 6, 2024
73 checks passed
@paulb777 paulb777 deleted the pb-msg-decode-bug branch January 6, 2024 01:38
@firebase firebase locked and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FCM registration token is nil at first app start after update to sdk version 10.19.0
5 participants