You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problematic Firebase Component: Firestore Database API
Other Firebase Components in use: N/A
Platform you are using the C++ SDK on: Linux (but exists on all platforms)
Platform you are targeting: desktop
[REQUIRED] Please describe the issue here:
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.
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. 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 as it deviates from the intent of the Firestore API.
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.
// Get should send a unary RPC - not a Streaming Listen RPC
Future<DocumentSnapshot> DocumentReferenceInternal::Get(Source source) {
auto promise =
promise_factory_.CreatePromise<DocumentSnapshot>(AsyncApis::kGet);
auto listener = ListenerWithPromise<api::DocumentSnapshot>(promise);
reference_.GetDocument(ToCoreApi(source), std::move(listener));
return promise.future();
}
The text was updated successfully, but these errors were encountered:
Hi @jimit-j-shah, DocumentReference.Get() uses Listen's global snapshot to ensure that when the SDK raises any snapshot, the data is consistent across all get doc(s) or snapshot listeners that are concurrently active in the SDK. This is something that we will not be able to change, however tou may be able to use transactions if you wish to read documents without creating a Listen stream.
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
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.
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. 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 as it deviates from the intent of the Firestore API.
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:
firebase-cpp-sdk/firestore/src/main/document_reference_main.cc
Line 59 in 5fead53
The text was updated successfully, but these errors were encountered: