Skip to content

Commit 1ef020b

Browse files
---
yaml --- r: 10185 b: refs/heads/mrschmidt-nosnapshot c: 94df9c0 h: refs/heads/master i: 10183: f6fd8a3
1 parent 03bfad2 commit 1ef020b

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

  • branches/mrschmidt-nosnapshot/google-cloud-clients/google-cloud-firestore/src

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ refs/heads/elharo-patch-4: 83538c7aa8a40cba7dd996ade653072cc67b3b65
129129
refs/heads/grpc: da780702593d72aa71d0223b3fa11add95062a0b
130130
refs/heads/mrschmidt-arrayuniontests: 98e5ed4411344fa5e3735e59b1d6a4da7333f241
131131
refs/heads/mrschmidt-list: a65b2421eaa3fbb59565fcd978df62ca6b6f1ec3
132-
refs/heads/mrschmidt-nosnapshot: e8cff3f90645c38723d08a8fecfacb8635fe64ea
132+
refs/heads/mrschmidt-nosnapshot: 94df9c0a286591a5b58a207e99f4d9cf030c7317

branches/mrschmidt-nosnapshot/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Watch.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ public void run() {
406406
Preconditions.checkState(stream == null);
407407

408408
current = false;
409-
hasPushed = false;
410409
nextAttempt = backoff.createNextAttempt(nextAttempt);
411410

412411
stream = firestore.streamRequest(Watch.this, firestore.getClient().listenCallable());

branches/mrschmidt-nosnapshot/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,35 @@ public void queryWatchReopensOnUnexceptedStreamEnd() throws InterruptedException
304304
awaitQuerySnapshot(new SnapshotDocument(ChangeType.ADDED, "coll/doc", SINGLE_FIELD_MAP));
305305
}
306306

307+
@Test
308+
public void queryWatchDoesntSendRaiseSnapshotOnReset() throws InterruptedException {
309+
// This test is meant to reproduce https://github.com/googleapis/google-cloud-dotnet/issues/2542
310+
addQueryListener();
311+
312+
awaitAddTarget();
313+
314+
send(addTarget());
315+
send(current());
316+
send(snapshot());
317+
318+
awaitQuerySnapshot();
319+
320+
close();
321+
awaitClose();
322+
awaitAddTarget();
323+
324+
send(addTarget());
325+
send(current());
326+
// This should not raise a snapshot, since nothing has changed since the last snapshot.
327+
send(snapshot());
328+
329+
send(doc("coll/doc", SINGLE_FIELD_PROTO));
330+
send(snapshot());
331+
332+
// Verify that we only receveived one snapshot.
333+
awaitQuerySnapshot(new SnapshotDocument(ChangeType.ADDED, "coll/doc", SINGLE_FIELD_MAP));
334+
}
335+
307336
@Test
308337
public void queryWatchDoesntReopenInactiveStream() throws InterruptedException {
309338
addQueryListener();

0 commit comments

Comments
 (0)