Skip to content

Commit 1c62992

Browse files
Don't go idle if there are outstanding gets() (#2414)
1 parent 6270c03 commit 1c62992

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

firebase-database/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# 19.7.0
22
- [added] Added `Query.startAfter()` and `Query.endBefore()` filter for paginating
33
RTDB queries.
4+
- [fixed] Fixed an issue with `Query.get()` that caused the client to go offline if
5+
only `get()` operations were pending.
46

57
# 19.6.0
68
- [fixed] Fixed a crash on some Pixel devices that occurred when closing the

firebase-database/src/main/java/com/google/firebase/database/connection/PersistentConnectionImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,7 @@ private void restoreState() {
10751075
onDisconnectRequestQueue.clear();
10761076

10771077
if (logger.logsDebug()) logger.debug("Restoring reads.");
1078+
// Restore gets
10781079
ArrayList<Long> outstandingGetKeys = new ArrayList<Long>(outstandingGets.keySet());
10791080
Collections.sort(outstandingGetKeys);
10801081
for (Long getId : outstandingGetKeys) {
@@ -1353,6 +1354,7 @@ public void run() {
13531354
*/
13541355
private boolean isIdle() {
13551356
return this.listens.isEmpty()
1357+
&& this.outstandingGets.isEmpty()
13561358
&& this.requestCBHash.isEmpty()
13571359
&& !this.hasOnDisconnects
13581360
&& this.outstandingPuts.isEmpty();

0 commit comments

Comments
 (0)