Skip to content

Add Query.get() to Realtime Database#818

Open
pmodernme wants to merge 3 commits intoGitLiveApp:masterfrom
pmodernme:feature/database-get
Open

Add Query.get() to Realtime Database#818
pmodernme wants to merge 3 commits intoGitLiveApp:masterfrom
pmodernme:feature/database-get

Conversation

@pmodernme
Copy link
Copy Markdown

Summary

Adds Query.get() across Android, Apple, and JS. Previous implementations used Query.valueEvents.first() to fetch a single value, but that returns either local or remote data depending on whether persistence is enabled. get() always fetches from the server and falls back to the locally-cached value (or null) if offline, giving consistent behavior regardless of persistence settings.

Cancellation is supported. If the coroutine is cancelled while waiting, the underlying request is cancelled as well.

Test plan

  • Run existing firebase-database common tests
  • Verify Query.get() returns remote data on Android, iOS, and JS
  • Verify correct fallback behavior when offline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant