Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ public void run() {
Preconditions.checkState(stream == null);

current = false;
hasPushed = false;
nextAttempt = backoff.createNextAttempt(nextAttempt);

stream = firestore.streamRequest(Watch.this, firestore.getClient().listenCallable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,35 @@ public void queryWatchReopensOnUnexceptedStreamEnd() throws InterruptedException
awaitQuerySnapshot(new SnapshotDocument(ChangeType.ADDED, "coll/doc", SINGLE_FIELD_MAP));
}

@Test
public void queryWatchDoesntSendRaiseSnapshotOnReset() throws InterruptedException {
// This test is meant to reproduce https://github.com/googleapis/google-cloud-dotnet/issues/2542
addQueryListener();

awaitAddTarget();

send(addTarget());
send(current());
send(snapshot());

awaitQuerySnapshot();

close();
awaitClose();
awaitAddTarget();

send(addTarget());
send(current());
// This should not raise a snapshot, since nothing has changed since the last snapshot.
send(snapshot());

send(doc("coll/doc", SINGLE_FIELD_PROTO));
send(snapshot());

// Verify that we only receveived one snapshot.
awaitQuerySnapshot(new SnapshotDocument(ChangeType.ADDED, "coll/doc", SINGLE_FIELD_MAP));
}

@Test
public void queryWatchDoesntReopenInactiveStream() throws InterruptedException {
addQueryListener();
Expand Down