Skip to content

idempotent allocateQuery and notifyLocalViewChanges #2264

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 20 commits into from
Oct 15, 2019

Conversation

wu-hui
Copy link
Contributor

@wu-hui wu-hui commented Oct 11, 2019

No description provided.

@wu-hui wu-hui changed the title idempotent allocate query idempotent allocateQuery and notifyLocalViewChanges Oct 11, 2019
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian left a comment

Choose a reason for hiding this comment

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

I left some comments, but overall this looks great. Can you wait with merging until applyremoteevent is merged?

@@ -812,24 +809,25 @@ export class LocalStore {
QueryPurpose.Listen,
txn.currentSequenceNumber
);
return this.queryCache.addQueryData(txn, queryData);
return this.queryCache.addQueryData(txn, queryData).next(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can just write this as:

 return this.queryCache.addQueryData(txn, queryData).next(() => queryData)

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.

updatedQueryData
);
}
}
return this.persistence.runTransaction(
'notifyLocalViewChanges',
'readwrite',
Copy link
Contributor

Choose a reason for hiding this comment

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

Here and below: Can you change this to readwrite-idempotent? Note that if you merge in the latest changes from mrschmidt/idempotent, the test runner will automatically run the transaction twice (so you can verify that this works).

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.

Copy link
Contributor Author

@wu-hui wu-hui left a comment

Choose a reason for hiding this comment

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

Will hold my PR until yours is merged. It'd be nice if you ping me when you merge it.

updatedQueryData
);
}
}
return this.persistence.runTransaction(
'notifyLocalViewChanges',
'readwrite',
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.

@@ -812,24 +809,25 @@ export class LocalStore {
QueryPurpose.Listen,
txn.currentSequenceNumber
);
return this.queryCache.addQueryData(txn, queryData);
return this.queryCache.addQueryData(txn, queryData).next(() => {
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.

@wu-hui wu-hui changed the base branch from mrschmidt/applyremoteevent to master October 15, 2019 14:37
@wu-hui wu-hui changed the base branch from master to mrschmidt/applyremoteevent October 15, 2019 14:37
@wu-hui wu-hui changed the base branch from mrschmidt/applyremoteevent to master October 15, 2019 16:21
@wu-hui wu-hui changed the base branch from master to mrschmidt/idempotent October 15, 2019 16:26
@wu-hui wu-hui merged commit 2dbe8cf into mrschmidt/idempotent Oct 15, 2019
hsubox76 pushed a commit that referenced this pull request Oct 15, 2019
* Add transaction retries (#2250)

* Marking SimpleDb calls as idempotent (#2251)

* Mark mostly readonly calls as idempotent (#2252)

* Fix test failure (#2256)

* Make handleUserChange idempotent (#2257)

* Temporarily disable CountingQueryEngine tests (#2258)

*  Improve test hack (#2259)

* Improve test hack

* Comment in test hack

* Make getNewDocumentChanges() idempotent (#2255)

* Add onCommitted listeners for transactions (#2265)

* Fix build

* Fix Lint

* Make applyRemoteEvent idempotent (#2263)

* Make notifyLocalViewChanges idempotent (#2268)

* Make releaseQuery idempotent (#2266)

* Mark acknowledgeBatch and rejectBatch idempotent (#2269)

* idempotent `allocateQuery` and `notifyLocalViewChanges` (#2264)

* Mark collectGarbage idempotent (#2267)

* Idempotency: Address TODOs, add Changelog (#2270)
@firebase firebase locked and limited conversation to collaborators Nov 15, 2019
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.

2 participants