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

Fix Document.Get behavior to send unary gRPC request instead of setting up a Listen stream for Document updates. #1699

Closed
jimit-j-shah opened this issue Mar 12, 2025 · 1 comment

Comments

@jimit-j-shah
Copy link

[REQUIRED] Please fill in the following fields:

  • Pre-built SDK from the website or open-source from this repo: _____
  • Firebase C++ SDK version: unity-v11.8.0
  • Problematic Firebase Component: Database API (Auth, Database, etc.)
  • Other Firebase Components in use: _____ (Auth, Database, etc.)
  • Platform you are using the C++ SDK on: Linux (Mac, Windows, or Linux)
  • Platform you are targeting: desktop (iOS, Android, and/or desktop)

[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

At the least, the Firestore C++ Mobile SDK API implementation for DocumentReference.Get() is sub-optimal. Instead a sending a single gRPC request for Firestore.GetDocument, it opens a Firestore.Listen stream to listen for DocumentSnapshots and serves the first snapshot as response to the Get() call.
Arguably, this may even be construed as incorrect behavior if one were to look at the network messages generated by these calls by this implementation.

At minimum, this has latency impact - cost of setting up and tearing down a Listen stream is higher and using it to only read first version of the DocumentSnapshot, the cost is not amortized. A unary gRPC request-response may work better.

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase C++ quickstarts ?
What's the issue repro rate? (eg 100%, 1/5 etc)
100%. Using the DocumentReference.Get() API.

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

// TODO(you): code here to reproduce the problem
@jimit-j-shah jimit-j-shah changed the title Fix Document.Get behavior Fix Document.Get behavior to send unary gRPC request instead of setting up a Listen stream for Document updates. Mar 12, 2025
@jimit-j-shah
Copy link
Author

Created this with incorrect type and unable to modify it now - see #1700 instead.

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

No branches or pull requests

2 participants