Skip to content

Remove instanceof IndexedDbRemoteDocumentCache check #2566

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
Jan 28, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

Goal: remove instanceof IndexedDbRemoteDocumentCache check in LocalStore to allow me to drop the import.

Realized: We don't even use the document result from getLastDocumentChange. So I changed it to only return the read time.

* Returns the set of documents that have been updated since the specified read
* time.
*/
// PORTING NOTE: This is only used for multi-tab synchronization.
Copy link
Contributor

Choose a reason for hiding this comment

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

Drive by comment: don't the comments still apply? (i.e. isn't this still only used for multi-tab?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment is already on the interface declaration.

@schmidt-sebastian
Copy link
Contributor Author

@var-const Do you have cycles for this today?

Copy link
Contributor

@var-const var-const left a comment

Choose a reason for hiding this comment

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

Code changes LGTM.

I'd suggest renaming the PR, though. getLastDocumentChange isn't just simplified, it's replaced with a different (simpler) function.

* SnapshotVersion.MIN if not available.
*/
// PORTING NOTE: This is only used for multi-tab synchronization.
getLastReadTime(
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: why is this declaration here, whereas previously getLastDocumentChange wasn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It allows me to use this method in Persistence without checking instanceof IndexedDbRemoteDocumentCache

@schmidt-sebastian schmidt-sebastian changed the title Simplify getLastDocumentChange Remove instanceof IndexedDbRemoteDocumentCache check Jan 28, 2020
@schmidt-sebastian
Copy link
Contributor Author

Changed the PR title to "Remove instanceof IndexedDbRemoteDocumentCache check" to be more in line with the intention of the PR. Thanks for the review!

1 similar comment
@schmidt-sebastian
Copy link
Contributor Author

Changed the PR title to "Remove instanceof IndexedDbRemoteDocumentCache check" to be more in line with the intention of the PR. Thanks for the review!

@schmidt-sebastian schmidt-sebastian merged commit 878c501 into master Jan 28, 2020
@firebase firebase locked and limited conversation to collaborators Feb 27, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/simplifyreadtime branch February 28, 2020 23:03
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.

4 participants