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

Make shutdown idempotent #3575

Merged
merged 17 commits into from
Aug 13, 2020
Merged

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Aug 6, 2020

The CI doesn't seem to work right now, but I still wanted to send this out for review. This replaces #3164 and makes it possible to call terminate() again if it failed with an IndexedDB exception.

This is the last PR for IndexedDB retries (at least for the current Firestore SDK, firestore-exp has one TODO to use a retryable operation).

Fixes #2755

@changeset-bot
Copy link

changeset-bot bot commented Aug 6, 2020

🦋 Changeset is good to go

Latest commit: c383178

We got this.

This PR includes changesets to release 10 packages
Name Type
@firebase/firestore Patch
firebase Patch
firebase-exp Patch
firebase-firestore-integration-test Patch
@firebase/testing Patch
firebase-browserify-test Patch
firebase-package-typings-test Patch
firebase-messaging-selenium-test Patch
firebase-typescript-test Patch
firebase-webpack-test 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 Aug 6, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (5b87b59) Head (502c883) Diff
    browser 249 kB 249 kB -135 B (-0.1%)
    esm2017 195 kB 195 kB +15 B (+0.0%)
    main 474 kB 474 kB +42 B (+0.0%)
    module 246 kB 246 kB -113 B (-0.0%)
    react-native 195 kB 195 kB +15 B (+0.0%)
  • @firebase/firestore/exp

    Type Base (5b87b59) Head (502c883) Diff
    browser 189 kB 189 kB +15 B (+0.0%)
    main 467 kB 467 kB +38 B (+0.0%)
    module 189 kB 189 kB +15 B (+0.0%)
    react-native 189 kB 189 kB +15 B (+0.0%)
  • @firebase/firestore/lite

    Type Base (5b87b59) Head (502c883) Diff
    browser 64.5 kB 64.5 kB -68 B (-0.1%)
    main 141 kB 141 kB -374 B (-0.3%)
    module 64.5 kB 64.5 kB -68 B (-0.1%)
    react-native 64.6 kB 64.6 kB -68 B (-0.1%)
  • @firebase/firestore/memory

    Type Base (5b87b59) Head (502c883) Diff
    browser 187 kB 187 kB -74 B (-0.0%)
    esm2017 146 kB 146 kB +55 B (+0.0%)
    main 348 kB 348 kB -48 B (-0.0%)
    module 185 kB 185 kB -52 B (-0.0%)
    react-native 146 kB 146 kB +55 B (+0.0%)
  • firebase

    Type Base (5b87b59) Head (502c883) Diff
    firebase-firestore.js 288 kB 287 kB -110 B (-0.0%)
    firebase-firestore.memory.js 227 kB 227 kB -50 B (-0.0%)
    firebase.js 823 kB 822 kB -112 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.

Basically LGTM with a favor to ask.

// RemoteStore as it will prevent the RemoteStore from retrieving
// auth tokens.
this._credentials.removeChangeListener();
this._queue.initiateShutdown();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is essentially a parallel change to the one in the iOS repo (which I hadn't yet ported everywhere else). During that change discussion arose that "shutdown" didn't really capture what was happening anymore: the queue is really still running, but there's just a limited set of operations you can perform on it. This method became enterRestrictedMode and the corresponding enqueue would be enqueueAndForgetEvenWhileRestricted.

Would you be willing to make that renaming change while you're in here? Usage ends up being the same as here: https://github.com/firebase/firebase-ios-sdk/blob/master/Firestore/core/src/core/firestore_client.cc#L230, so structurally this is already a move toward convergence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. This is a good reminder that I need to port the RemoteStore modes to the other platforms.

@wilhuff wilhuff assigned schmidt-sebastian and unassigned wilhuff Aug 7, 2020
@schmidt-sebastian schmidt-sebastian merged commit 960093d into master Aug 13, 2020
@google-oss-bot google-oss-bot mentioned this pull request Aug 18, 2020
@firebase firebase locked and limited conversation to collaborators Sep 13, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/muchbettershutdown branch November 9, 2020 22:36
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.

Offline Mode Improvements
3 participants