Skip to content

Remove support for lastStreamToken #3132

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 3 commits into from
May 29, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented May 28, 2020

This extracts the Stream Token removal from #2995 into a separate PR, so it can be more easily reverted should the backend add full support for the stream tokens.

We are removing the Stream Tokens to ease IndexedDB recovery.

Proof of concept PR that implements IndexedDB recovery with Stream Tokens: #3131

@schmidt-sebastian schmidt-sebastian force-pushed the mrschmidt/removelaststreamtoken branch from c38dff8 to 44731f9 Compare May 28, 2020 21:39
@schmidt-sebastian schmidt-sebastian changed the title Merge Remove support for lastStreamToken May 28, 2020
@schmidt-sebastian schmidt-sebastian requested a review from wilhuff May 28, 2020 21:41
@google-oss-bot
Copy link
Contributor

google-oss-bot commented May 28, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (0d6f14e) Head (39d7759) Diff
    browser 252 kB 250 kB -1.42 kB (-0.6%)
    esm2017 195 kB 194 kB -1.00 kB (-0.5%)
    main 494 kB 491 kB -2.66 kB (-0.5%)
    module 249 kB 248 kB -1.42 kB (-0.6%)
  • @firebase/firestore/lite

    Type Base (0d6f14e) Head (39d7759) Diff
    main ? 6.51 kB ? (?)
  • @firebase/firestore/memory

    Type Base (0d6f14e) Head (39d7759) Diff
    browser 192 kB 191 kB -1.07 kB (-0.6%)
    esm2017 149 kB 148 kB -766 B (-0.5%)
    main 370 kB 368 kB -1.91 kB (-0.5%)
    module 190 kB 189 kB -1.07 kB (-0.6%)
  • @firebase/util

    Type Base (0d6f14e) Head (39d7759) Diff
    browser 19.5 kB 19.6 kB +143 B (+0.7%)
    esm2017 17.4 kB 17.5 kB +126 B (+0.7%)
    main 19.5 kB 19.6 kB +143 B (+0.7%)
    module 18.6 kB 18.7 kB +126 B (+0.7%)
  • firebase

    Type Base (0d6f14e) Head (39d7759) Diff
    firebase-firestore.js 290 kB 289 kB -1.43 kB (-0.5%)
    firebase-firestore.memory.js 232 kB 231 kB -1.08 kB (-0.5%)
    firebase.js 823 kB 821 kB -1.43 kB (-0.2%)

Test Logs

// operation failed and we fail the pending operation.
if (error && this.writeStream.handshakeComplete) {
// This error affects the actual write.
await this.handleWriteError(error!);
Copy link
Contributor

Choose a reason for hiding this comment

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

We're still tracking the lastStreamToken and it's possible that if we're restarting the write stream after some successful writes, the server could reject the stream token we supply. This means we still need to handle the handshake error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add the handshake code back if you prefer (it might be safer to reduce the churn here), but what do you think about the fix in b530cd5?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no strong preference on the general strategy, though it seems like clearing when the stream starts could be more bullet proof.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified it to match the assignment of handshakeComplete_, which is now true only if the stream token is non empty.

@wilhuff wilhuff assigned schmidt-sebastian and unassigned wilhuff May 29, 2020
@schmidt-sebastian schmidt-sebastian removed their assignment May 29, 2020
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

@schmidt-sebastian schmidt-sebastian merged commit fa8d528 into master May 29, 2020
@firebase firebase locked and limited conversation to collaborators Jun 29, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/removelaststreamtoken branch July 9, 2020 17:44
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