Skip to content

Commit 8c321f0

Browse files
rlazojmwskischmidt-sebastian
authored
Cherry pick RTDB fixes for M85 (#330)
* RTDB Query get method must be public (#2231) * Don't crash SDK is socket.close() fails (#2216) Co-authored-by: Jan Wyszynski <[email protected]> Co-authored-by: Sebastian Schmidt <[email protected]>
1 parent fb8b606 commit 8c321f0

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

firebase-database/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# 19.5.1 (Unreleased)
1+
# Unreleased
2+
- [fixed] Fixed a crash on some Pixel devices that occurred when closing the
3+
network connection.
4+
- [added] Added `Query.get()`, which allows users to receive a single data
5+
snapshot. `Query.get()` returns the latest value even if an older value
6+
already exists in cache.
7+
8+
# 19.5.1
29
- [fixed] Fixes a regression in v19.4 that may cause assertion failures,
310
especially when persistence is enabled.
411

firebase-database/src/main/java/com/google/firebase/database/Query.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public ChildEventListener addChildEventListener(@NonNull ChildEventListener list
167167
* connected, fall back to a locally-cached value.
168168
*/
169169
@NonNull
170-
Task<DataSnapshot> get() {
170+
public Task<DataSnapshot> get() {
171171
return repo.getValue(this);
172172
}
173173

firebase-database/src/main/java/com/google/firebase/database/tubesock/WebSocket.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ private synchronized void closeSocket() {
261261
if (socket != null) {
262262
try {
263263
socket.close();
264-
} catch (IOException e) {
265-
throw new RuntimeException(e);
264+
} catch (Exception e) {
265+
eventHandler.onError(new WebSocketException("Failed to close", e));
266266
}
267267
}
268268
state = State.DISCONNECTED;

0 commit comments

Comments
 (0)