Skip to content

Don't update query target metadata for updates #1063

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 4 commits into from
Jul 30, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions packages/firestore/src/local/indexeddb_query_cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,7 @@ export class IndexedDbQueryCache implements QueryCache {
transaction: PersistenceTransaction,
queryData: QueryData
): PersistencePromise<void> {
return this.saveQueryData(transaction, queryData).next(() => {
return this.retrieveMetadata(transaction).next(metadata => {
if (this.updateMetadataFromQueryData(queryData, metadata)) {
return this.saveMetadata(transaction, metadata);
} else {
return PersistencePromise.resolve();
}
});
});
return this.saveQueryData(transaction, queryData);
Copy link

Choose a reason for hiding this comment

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

You will still potentially need to update the metadata. Once QueryCache starts tracking the highest sequence number, it is likely that an update will trigger a metadata write.

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 updated the PR to allow future Greg to set the sequence number as part of the setLastRemoteSnapshotVersion call. Let me know if that will work as is for GC.

I am also still accepting nominations for the API name voting challenge.

}

removeQueryData(
Expand Down