Address potential IndexedDB failure in synchronizeQueryViewsAndRaiseSnapshots #3113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes a
releaseQuery
call from Multi-Tab synchronization. The idea of this code path in synchronizeQueryViewsAndRaiseSnapshots is that it releases and re-allocates a query if a new primary already has a local query view but needs to make sure that it matches the data in IndexedDB before starting a Listen.We should not need to call
releaseTarget
here, since it overwrites the target data with potentially stale state. Instead, we just load the latest state viaallocateTarget
which has the ability to load a target from disk or from memory. I added a check to also update the in-memory data when it is stale, but I wasn't able to find any difference for this using a spec tests I hacked together (not committed).Addresses #2755