Skip to content

Remove Index-Free assert #800

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
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions firebase-firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

# 21.1.1
- [fixed] Addressed a regression in 21.1.0 that caused the crash: "Cannot add
document to the RemoteDocumentCache with a read time of zero".

# 21.1.0
- [feature] Added a `terminate()` method to `FirebaseFirestore` which
terminates the instance, releasing any held resources. Once it completes, you
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ private void initialize(Context context, User user, boolean usePersistence, long
}

persistence.start();
// TODO(index-free): Use IndexFreeQueryEngine/IndexedQueryEngine as appropriate.
// TODO(index-free): Use IndexFreeQueryEngine/IndexedQueryEngine as appropriate. When we enable
// IndexFreeQueryEngine, we have to reset the "lastLimboFreeSnapshotVersion" for all persisted
// QueryData as we had to revert the part of the change that ensured that the data is reliable.
QueryEngine queryEngine = new SimpleQueryEngine();
localStore = new LocalStore(persistence, queryEngine, user);
if (gc != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ final class MemoryRemoteDocumentCache implements RemoteDocumentCache {

@Override
public void add(MaybeDocument document, SnapshotVersion readTime) {
hardAssert(
!readTime.equals(SnapshotVersion.NONE),
"Cannot add document to the RemoteDocumentCache with a read time of zero");
// TODO(index-free): This assert causes a crash for one of our customers. Re-add the assert once
// we have fixed the root cause and cleaned up the underlying data.
// hardAssert(
// !readTime.equals(SnapshotVersion.NONE),
// "Cannot add document to the RemoteDocumentCache with a read time of zero");
docs = docs.insert(document.getKey(), new Pair<>(document, readTime));

persistence.getIndexManager().addToCollectionParentIndex(document.getKey().getPath().popLast());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ final class SQLiteRemoteDocumentCache implements RemoteDocumentCache {

@Override
public void add(MaybeDocument maybeDocument, SnapshotVersion readTime) {
hardAssert(
!readTime.equals(SnapshotVersion.NONE),
"Cannot add document to the RemoteDocumentCache with a read time of zero");
// TODO(index-free): This assert causes a crash for one of our customers. Re-add the assert once
// we have fixed the root cause and cleaned up the underlying data.
// hardAssert(
// !readTime.equals(SnapshotVersion.NONE),
// "Cannot add document to the RemoteDocumentCache with a read time of zero");

String path = pathForKey(maybeDocument.getKey());
Timestamp timestamp = readTime.getTimestamp();
Expand Down