Skip to content

Refetch token if attempt was invalidated #3184

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

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Conversation

schmidt-sebastian
Copy link
Contributor

When a token refresh fails because of we got a token callback while fetching the token, we could refetch the token instead of throwing an error with Code ABORTED.

This is meant to address #2923 (comment), which shows:

[Log] [2020-06-04T17:00:57.554Z]  @firebase/firestore: – "Firestore (7.14.5): PersistentStream" – "close with error: FirebaseError: [code=unknown]: Fetching auth token failed: getToken aborted due to token change." (vendor.js, line 179863)
[Error] [2020-06-04T17:00:57.555Z]  @firebase/firestore: – "Firestore (7.14.5): Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=unknown]…"


@schmidt-sebastian schmidt-sebastian changed the title Mrschmidt/tokens Refetch token if attempt was invalidated Jun 7, 2020
@google-oss-bot
Copy link
Contributor

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (0fac7bd) Head (4b9c75a) Diff
    browser 252 kB 252 kB +23 B (+0.0%)
    esm2017 195 kB 195 kB +17 B (+0.0%)
    main 494 kB 494 kB +25 B (+0.0%)
    module 249 kB 249 kB +23 B (+0.0%)
  • @firebase/firestore/lite

    Type Base (0fac7bd) Head (4b9c75a) Diff
    main 138 kB 138 kB +24 B (+0.0%)
  • @firebase/firestore/memory

    Type Base (0fac7bd) Head (4b9c75a) Diff
    browser 192 kB 192 kB +23 B (+0.0%)
    esm2017 149 kB 149 kB +17 B (+0.0%)
    main 370 kB 370 kB +25 B (+0.0%)
    module 190 kB 190 kB +23 B (+0.0%)
  • firebase

    Type Base (0fac7bd) Head (4b9c75a) Diff
    firebase-firestore.js 290 kB 290 kB +21 B (+0.0%)
    firebase-firestore.memory.js 232 kB 232 kB +21 B (+0.0%)
    firebase.js 823 kB 823 kB +21 B (+0.0%)

Test Logs

Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants