Repository navigation
Conversation
4992afc to
9df0441
Compare
9df0441 to
468d47a
Compare
346c0d3 to
f0596a8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ 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 f0596a8. Configure here.
| active_conditions_.reset(); | ||
| } | ||
| StartSynchronizers(); | ||
| } |
There was a problem hiding this comment.
Stale shutdown aborts FDv2 retry
High Severity
OnFDv2RetryTimer closes the FDv1 adapter while its Next() is still in the orchestrator's WhenAny. That unblocks the old future with Shutdown, which is posted onto the executor after the new FDv2 synchronizer has already been started. OnSynchronizerResult then treats that stale Shutdown as belonging to the replacement and resets active_synchronizer_, so the SDK is left with no live source after the TTL elapses.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f0596a8. Configure here.
|
Note Agent disclosure: this comment and the linked branch were produced by an AI agent (Claude Code) working for @kinyoklion, as part of a multi-agent review of this PR. The failure was reproduced and the fix checked by building and running the client unit tests locally (Debug, ASan/UBSan). Please review it with that in mind. The FDv2 retry after the fallback TTL tears down the synchronizer it just startedThis is the problem Bugbot raised here. It reproduces in a unit test, and it happens every time the TTL expires while the FDv1 tier is active. What happens (line links are at f0596a8):
After that there is no synchronizer and no retry timer, and the status still reads VALID from the last FDv1 data. Flag updates stop silently until the next identify. #619 gives every built-in mode an FDv1 fallback, so once it lands this would happen on every TTL expiry. The same root cause shows up in a narrower window too. If an FDv1 result has already been posted when the retry runs, it is applied after FDv2 has restarted, and it calls
Branch with a test and a fix
With the fix, the full client unit suite passes (236 tests). Another way to fix it is to put the TTL future into the same A heads-up, not verified: the server SDK's |
f0596a8 to
859218a
Compare
There was a problem hiding this comment.
Risk: high.
Automated risk review (dry run): High
This PR would not be automatically approved. Human approval required.
Why: Client FDv2 fallback in fdv2_data_source.cpp and fdv1_adapter_synchronizer.cpp changes live streaming, and unresolved Bugbot findings include a high-severity stale shutdown that can drop the active synchronizer after the fallback TTL.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
859218a to
81b74a7
Compare
81b74a7 to
204dc29
Compare




Summary
Honors the service's directive to move the client off FDv2 back to FDv1, and provides an FDv1 source to fall back to.
Note
Overview
When the service signals an FDv1 fallback (via response metadata or a goodbye), the client SDK still applies any flag payload in that response, then switches synchronizer rotation from FDv2 to a configured FDv1 tier instead of continuing FDv2.
A new
FDv1AdapterSynchronizerwraps an existing FDv1IDataSourceso it can participate in FDv2 orchestration: FDv1 Init/Upsert/Apply updates becomeFDv2SourceResultchangesets (full/partial, no selector), and data-source status errors map to interrupted/terminal results, with lazy start on the firstNext()and clean shutdown onClose().FDv2DataSourcegainsEngageFDv1FallbackLockedand a TTL timer toSwitchBackToFDv2and restart FDv2 synchronizers;Close()cancels pending retry timers. If the directive arrives but no FDv1 fallback synchronizer is configured, the SDK reports interrupted with a explicit “no FDv1 fallback configured” message while keeping flags already received.Unit tests cover the adapter lifecycle/mapping and FDv2 orchestration (apply-before-switch, FDv1 tier start, disconnect without tier, FDv2 retry after TTL).
Reviewed by Cursor Bugbot for commit 204dc29. Bugbot is set up for automated code reviews on this repo. Configure here.