Conversation
e05b5ed to
db55b09
Compare
db55b09 to
d2cdc4e
Compare
bd219dc to
e78670c
Compare
e78670c to
20d58d0
Compare
6146cea to
44884f9
Compare
44884f9 to
d675917
Compare
d675917 to
eb8ad4a
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 fc7d735. Configure here.
| if (!ReadCached(context)) { | ||
| return std::nullopt; | ||
| } | ||
| return ReadIndexAt(freshness_key_).GetTimestamp(FreshnessId(context)); |
There was a problem hiding this comment.
Freshness outlives overwritten flag data
Medium Severity
ReadFreshness treats any cached flags for the context's CanonicalKey as proof the stored timestamp still describes that data. Flag data is keyed only by that key, while freshness is keyed by a hash of the full context, so a later payload for the same key with different attributes overwrites the flags and leaves the earlier timestamp in place. ReadFreshness then reports the old time for the new data, which can make a poll wait on evaluations that were never confirmed for this attribute set.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit fc7d735. Configure here.
fc7d735 to
60b04ea
Compare


Summary
Adds an FDv2 cache initializer so the client can begin evaluating from its local per-context cache before the network responds, and tracks how fresh each context's cached data is.
Design note: this client persists a per-context freshness timestamp keyed by a hash of the full context, matching Android. Flutter's FDv2 freshness is different -- an in-memory, per-synchronizer timestamp that is neither persisted nor keyed by context.
Internal only. Not user-selectable yet.
Note
Overview
Adds an FDv2 cache initializer that hydrates the flag store from per-context persistence before network init: a hit yields a full changeset without a selector (so cached data can be evaluated but not used as a delta basis), and a miss yields a none intent so the initializer chain continues. The factory marks itself via
IsFromCache()for orchestration.Flag persistence gains
ReadCached/ReadFreshness, exposes the cache throughFlagManager::Cache(), and tracks service-confirmed freshness in a separateContextFreshnessindex keyed by a hash of the full context (not just the key). NetworkApplypaths record freshness on payloads and on none confirmations;from_cacheapplies still update the store but do not write back or record freshness.ReadFreshnessis suppressed when flag data for the context is no longer cached, including after LRU eviction edge cases.Docs/comments on
IDataSourceUpdateSink::Applyclarify cache-sourced semantics. Tests cover the cache initializer and freshness/eviction behavior.Reviewed by Cursor Bugbot for commit 60b04ea. Bugbot is set up for automated code reviews on this repo. Configure here.