feat: Add FDv2 polling sources to the client - #610
Conversation
6485e51 to
d536b60
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6960b1e. Configure here.
| promise->Resolve(res); | ||
| }); | ||
| return future; | ||
| } |
There was a problem hiding this comment.
Invalid URL is treated as retryable
Medium Severity
FDv2PollingSynchronizer never checks whether MakeFDv2PollRequest produced a valid request. An unparseable base_url is sent to the requester, which fails as a transport error and is surfaced as Interrupted. That is a permanent configuration failure, so the orchestrator would keep retrying instead of stopping.
Reviewed by Cursor Bugbot for commit 6960b1e. Configure here.


Summary
Adds the FDv2 polling sources -- a one-shot polling initializer and an interval-based polling synchronizer -- over a shared request builder and response handler that feed the response through the protocol handler and the changeset translation.
stateas thebasisquery parameter for deltas, with a poll-interval floor to avoid hammering the service.Design note: this client sends no conditional-request validator (
If-None-Match/ETag), unlike the Flutter and Android clients, which track a per-context ETag and act on real304responses. The spec lists omittingIf-None-Matchentirely as an accepted way to avoid the cross-context ETag hazard, and since every SDK already sends thebasisselector for deltas, dropping the ETag costs little here. Because noIf-None-Matchis ever sent, a304should not occur, so the304 -> nonehandling is defensive.Internal only. The orchestrator that runs these arrives in a later change.
Note
Overview
Adds FDv2 client polling to the C++ client SDK: shared HTTP request/response plumbing plus two
IFDv2*implementations that are not wired into the public client yet.Shared polling core builds
sdk/poll/evalrequests fromFDv2RequestConfig(context in the path as base64url GET or JSON POST, optionalbasisandwithReasons) and maps responses throughFDv2ProtocolHandlerintoFDv2SourceResult(changesets, goodbye, retries vs terminal errors). It parsesX-LD-EnvIdand FDv1 fallback headers; body-level goodbye TTL overrides header fallback.304is handled as a no-op changeset even though this client deliberately omitsIf-None-Match.FDv2PollingInitializerperforms a single async poll with cancel-on-Close.FDv2PollingSynchronizerrate-limits repeated polls (minimum interval clamp, respects last poll time) and supports shutdown while waiting or in flight.Unit tests cover URL construction, response/error/fallback behavior, and synchronizer timing/close semantics.
CMakeLists.txtregisters the new sources.Reviewed by Cursor Bugbot for commit 6960b1e. Bugbot is set up for automated code reviews on this repo. Configure here.