Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
puf opened this issue Mar 8, 2024 · 2 comments
Labels
api: database type: bug Something isn't working

Comments

@puf
Copy link

puf commented Mar 8, 2024

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.

@lehcar09
Copy link
Contributor

Hi @puf, thank you for filing the issue. I was able to reproduce the behavior where no callback is invoked. It makes sense to me to expect the failure listener to be invoked after the server call times out. I’ll inform our engineers about this and see what we can do here.

@lehcar09 lehcar09 added the type: bug Something isn't working label Mar 11, 2024
@kennyli92
Copy link

Any update on this? There's another similar bug that never times out when there is no data at the reference. I would expect a failure or a null value to return on success.

val ref = database.getReference("ref").get().await()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: database type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants