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

[Auth] Detect if IndexedDB returns an empty array in platform_browser/persistence. #7825

Merged
merged 4 commits into from
Nov 29, 2023

Conversation

DellaBitta
Copy link
Contributor

@DellaBitta DellaBitta commented Nov 29, 2023

Discussion

Protection from enumerating an empty list in Auth's reading of IndexedDB results, as this causes errors in some macOS and iOS browser runtimes.

This change addresses Issue #7737 which reported an error of TypeError undefined is not an object (evaluating 'o.fbase_key').

Testing

CI.

API Changes

N/A

Copy link

changeset-bot bot commented Nov 29, 2023

🦋 Changeset detected

Latest commit: e6ca30e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/auth Patch
@firebase/auth-compat Patch
firebase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 29, 2023

Size Report 1

Affected Products

  • @firebase/app-check

    TypeBase (e8ff8b8)Merge (1383318)Diff
    browser26.2 kB26.3 kB+74 B (+0.3%)
    esm531.5 kB31.6 kB+90 B (+0.3%)
    main32.7 kB32.8 kB+90 B (+0.3%)
    module26.2 kB26.3 kB+74 B (+0.3%)
  • @firebase/auth

    TypeBase (e8ff8b8)Merge (1383318)Diff
    browser177 kB177 kB+23 B (+0.0%)
    cordova205 kB205 kB+23 B (+0.0%)
    esm5230 kB230 kB+23 B (+0.0%)
    module177 kB177 kB+23 B (+0.0%)
  • @firebase/auth/cordova

    TypeBase (e8ff8b8)Merge (1383318)Diff
    browser205 kB205 kB+23 B (+0.0%)
    module205 kB205 kB+23 B (+0.0%)
  • @firebase/auth/internal

    TypeBase (e8ff8b8)Merge (1383318)Diff
    browser188 kB188 kB+23 B (+0.0%)
    esm5244 kB244 kB+23 B (+0.0%)
    module188 kB188 kB+23 B (+0.0%)
  • bundle

    TypeBase (e8ff8b8)Merge (1383318)Diff
    app-check (CustomProvider)36.8 kB36.9 kB+72 B (+0.2%)
    app-check (ReCaptchaEnterpriseProvider)39.3 kB39.4 kB+72 B (+0.2%)
    app-check (ReCaptchaV3Provider)39.3 kB39.4 kB+72 B (+0.2%)
    auth (Anonymous)73.7 kB73.7 kB+18 B (+0.0%)
    auth (EmailAndPassword)81.6 kB81.6 kB+18 B (+0.0%)
    auth (GoogleFBTwitterGitHubPopup)100 kB100 kB+18 B (+0.0%)
    auth (GooglePopup)97.6 kB97.6 kB+18 B (+0.0%)
    auth (GoogleRedirect)97.8 kB97.8 kB+18 B (+0.0%)
    auth (Phone)84.0 kB84.0 kB+18 B (+0.0%)
  • firebase

    TypeBase (e8ff8b8)Merge (1383318)Diff
    firebase-app-check-compat.js23.3 kB23.4 kB+68 B (+0.3%)
    firebase-app-check.js25.0 kB25.0 kB+72 B (+0.3%)
    firebase-auth-compat.js136 kB136 kB+15 B (+0.0%)
    firebase-auth-cordova.js174 kB174 kB+16 B (+0.0%)
    firebase-auth.js147 kB147 kB+16 B (+0.0%)
    firebase-compat.js779 kB779 kB+83 B (+0.0%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 29, 2023

Size Analysis Report 1

Affected Products

  • @firebase/app-check

    • CustomProvider

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size7.65 kB7.72 kB+72 B (+0.9%)
      size-with-ext-deps25.6 kB25.7 kB+72 B (+0.3%)
    • ReCaptchaEnterpriseProvider

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size11.3 kB11.4 kB+72 B (+0.6%)
      size-with-ext-deps29.2 kB29.2 kB+72 B (+0.2%)
    • ReCaptchaV3Provider

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size11.3 kB11.4 kB+72 B (+0.6%)
      size-with-ext-deps29.1 kB29.2 kB+72 B (+0.2%)
    • getLimitedUseToken

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size7.22 kB7.29 kB+72 B (+1.0%)
      size-with-ext-deps24.7 kB24.8 kB+72 B (+0.3%)
    • getToken

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size7.28 kB7.35 kB+72 B (+1.0%)
      size-with-ext-deps24.8 kB24.9 kB+72 B (+0.3%)
    • initializeAppCheck

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size11.1 kB11.2 kB+72 B (+0.6%)
      size-with-ext-deps35.8 kB35.9 kB+72 B (+0.2%)
    • onTokenChanged

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size7.37 kB7.44 kB+72 B (+1.0%)
      size-with-ext-deps24.9 kB25.0 kB+72 B (+0.3%)
    • setTokenAutoRefreshEnabled

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size7.37 kB7.44 kB+72 B (+1.0%)
      size-with-ext-deps24.9 kB24.9 kB+72 B (+0.3%)
  • @firebase/auth

    • getAuth

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size71.9 kB71.9 kB+18 B (+0.0%)
      size-with-ext-deps99.6 kB99.6 kB+18 B (+0.0%)
    • indexedDBLocalPersistence

      Size

      TypeBase (e8ff8b8)Merge (1383318)Diff
      size44.8 kB44.8 kB+18 B (+0.0%)
      size-with-ext-deps65.8 kB65.9 kB+18 B (+0.0%)

Test Logs

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

@DellaBitta DellaBitta marked this pull request as ready for review November 29, 2023 19:48
Copy link
Member

@yuchenshi yuchenshi left a comment

Choose a reason for hiding this comment

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

Would you mind adding the error message to the PR description to make it more searchable? ty

Copy link
Contributor

@prameshj prameshj left a comment

Choose a reason for hiding this comment

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

Thanks!

I am curious why the indexDB read would be empty (if the user was indeed persisted), but maybe that's a different issue than #7737

@DellaBitta DellaBitta merged commit 70e4cf6 into master Nov 29, 2023
41 checks passed
@DellaBitta DellaBitta deleted the ddb-persistence-fkey branch November 29, 2023 20:46
@google-oss-bot google-oss-bot mentioned this pull request Dec 4, 2023
@firebase firebase locked and limited conversation to collaborators Dec 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants