firebase / firebase/firebase-android-sdk

Realtime Database get() API doesn't time out when getting data that is not in cache while offline

Open
#5,771 2 comments 1 reaction 0 assignees View on GitHub
api: database type: bug
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 9h
Merged PRs (30d)
31

Description

Context: https://stackoverflow.com/q/78117075

### [REQUIRED] Step 2: Describe your environment

* Android Studio version: N/A
* Firebase Component: Database
* Component version: 20.3.1 (BoM: 32.7.4)

### [REQUIRED] Step 3: Describe the problem

Code:

val ref = database
.getReference("timeline/240306/stations")
.orderByChild("tripName")
.equalTo(tripNameDouble)

ref.get()
.addOnSuccessListener{...}
.addOnFailureListener{...}
.addOnCanceledListener{...}

When executing this code **while offline** when never having executed this query/accessed this path before (so without any info for it in the cache), I expect the failure listener to be invoked, after the call to the server times out. Instead none of the callbacks is ever invoked, which means developers have to work around this condition with their own timeout mechanism.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.