Skip to content

feat: Discard the FDv2 selector when the evaluation context changes - #622

Open
beekld wants to merge 3 commits into
mainfrom
bklimt/SDK-3035/client-fdv2-identify
Open

beekld wants to merge 3 commits into
mainfrom
bklimt/SDK-3035/client-fdv2-identify

Conversation

@beekld

@beekld beekld commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Discards the FDv2 selector on a context change, so a selector earned for one context is never reused for another.


Note

Overview
On context change via IdentifyAsync, the client now clears the in-memory FDv2 selector after the old data source shuts down and before the new one starts, so a selector tied to the previous context is never reused.

RestartDataSource and StartAsyncInternal take a clear_selector flag: identify passes true; ordinary StartAsync passes false. FlagManager::ClearSelector forwards to FlagStore::ClearSelector, which drops only the selector and leaves cached flag values in place.

New tests cover per-context cache reads in FDv2CacheInitializer and LoadCached behavior on cache miss (retain in-memory data) vs hit (replace with persisted data).

Reviewed by Cursor Bugbot for commit 2597cf9. Bugbot is set up for automated code reviews on this repo. Configure here.

@beekld
beekld force-pushed the bklimt/SDK-3035/client-fdv2-identify branch from d427e51 to 76a37e9 Compare October 3, 2026 01:21
@beekld
beekld force-pushed the bklimt/SDK-3035/client-fdv2-identify branch from 76a37e9 to a268f20 Compare October 5, 2026 18:00
@beekld
beekld added this pull request to stack #627 October 5, 2026 18:00
@beekld
beekld removed this pull request from stack #627 October 5, 2026 18:05
@beekld
beekld added this pull request to stack #628 October 5, 2026 18:10
@beekld
beekld removed this pull request from stack #628 October 5, 2026 19:18
@beekld
beekld added this pull request to stack #629 October 5, 2026 19:24
Base automatically changed from bklimt/SDK-3033/client-fdv2-cache-initializer to main October 5, 2026 23:25
@beekld
beekld force-pushed the bklimt/SDK-3035/client-fdv2-identify branch 2 times, most recently from 455610f to 4993c9f Compare October 6, 2026 05:04
@beekld
beekld force-pushed the bklimt/SDK-3035/client-fdv2-identify branch 2 times, most recently from 12dd3cb to ce1105e Compare November 17, 2026 20:12
@beekld
beekld marked this pull request as ready for review November 17, 2026 20:34
@beekld
beekld requested a review from a team as a code owner November 17, 2026 20:34
@cursor cursor Bot added the risk:medium label Nov 17, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium.

Automated risk review (dry run): Medium

This PR would not be automatically approved. Human approval required.

Why: Identify-time FDv2 selector clearing in client_impl.cpp is a client SDK behavior change without an identify-path test in this PR; added tests cover cache and persistence only.

If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.

Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@beekld
beekld force-pushed the bklimt/SDK-3035/client-fdv2-identify branch from ce1105e to 2597cf9 Compare November 18, 2026 00:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants