Skip to content

[Multi-Tab] Don't add change log entry when there are no changes #1051

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 2 commits into from
Jul 26, 2018

Conversation

schmidt-sebastian
Copy link
Contributor

FriendlyEats writes a bunch of empty change events to the document change log. Let's not do that.

Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

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

LGTM with question

let changedKeys = documentKeySet();
for (const maybeDocument of maybeDocuments) {
if (maybeDocuments.length > 0) {
const documentStore = remoteDocumentsStore(transaction);
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems fine... but why are we calling addEntries() with an empty list anyway? Should we be filtering this out at a higher-level (potentially preventing even more unnecessary work?

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 was pondering about doing this one layer up, but ended up picking the remote_document_cache for no particular reason (other than this would solve the same problem no matter who calls addEntries). Leaving as is.

@schmidt-sebastian schmidt-sebastian merged commit 674882f into firestore-multi-tab Jul 26, 2018
@schmidt-sebastian schmidt-sebastian deleted the multitab-noemptychangelog branch August 3, 2018 17:15
@firebase firebase locked and limited conversation to collaborators Oct 18, 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.

3 participants