[Bug] Fix Document.Get behavior to send unary gRPC request instead of setting up a Listen stream for Document updates
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- cpp, grpc
调研方向
从 firestore/src/main/document_reference_main.cc 中的 DocumentReferenceInternal::Get 开始,跟踪所引用的 Firestore API 实现。确认如何选择 GetDocument 和 Listen 路径,然后验证 Get() 使用 unary 请求,并且仍会返回预期的第一个 DocumentSnapshot,而不会打开 Listen 流。
由索引模型根据 Issue 内容生成。
描述
[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 onwards
- 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.
Relevant Code:
// 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();
}
- 主要语言
- C++
- 星标
- 326
- 派生
- 138
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 6
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-cpp-sdk 的其他 Issue
-
new type: question
难度 2/5 1-3 小时 新手友好度 85/100
firebase/firebase-cpp-sdk#1926 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
firebase/firebase-cpp-sdk#1905 · 2 条评论 ·
-
api: firestore
难度 5/5 一周以上 新手友好度 35/100
firebase/firebase-cpp-sdk#1920 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 70/100
firebase/firebase-cpp-sdk#1904 · 1 条评论 ·
-
new type: question
难度 4/5 3-5 天 新手友好度 45/100
firebase/firebase-cpp-sdk#1892 · 1 条评论 ·
查看 firebase/firebase-cpp-sdk 的全部 Issue
相似的 Issue
-
prio:medium status:idea type:feat
难度 2/5 1-3 小时 新手友好度 82/100
-
tests
难度 2/5 1-3 小时 新手友好度 88/100
-
kind/bug needs-sig needs-triage
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 78/100
drogonframework/drogon#2605 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
ArthurSonzogni/FTXUI#1363 ·