refactor(remote-config): /v1/config path, app_user_id body, refresh dedupe#3648
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 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 e817f23. Configure here.
| if (isRefreshing.getAndSet(true)) { | ||
| debugLog { "Remote config refresh already in progress. Skipping." } | ||
| return | ||
| } |
There was a problem hiding this comment.
Dropped refresh on user change
High Severity
refreshRemoteConfig skips any overlapping call without comparing appUserID. After a login or identity switch, a refresh for the new user can be dropped while an in-flight request still uses the previous user’s app_user_id, and the response is persisted to the shared disk cache with no follow-up fetch for the new user.
Reviewed by Cursor Bugbot for commit e817f23. Configure here.
There was a problem hiding this comment.
Ignoring for now. We might want to cancel the old request in that case but that can be done separately.
…edupe - Move GetRemoteConfig endpoint from /v2/config to /v1/config - Add app_user_id to the /v1/config request body (Backend.getRemoteConfig + RemoteConfigManager) - Dedupe overlapping RemoteConfigManager.refreshRemoteConfig calls with a single in-flight guard Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e817f23 to
f070e8c
Compare



Description
3 main changes here:
/v1/configinstead of/v2/configapp_user_idto request body for configNote
Medium Risk
Changes the live remote-config URL and request contract and ties sync to the current app user ID; incorrect wiring could miss or mis-scope config until the next refresh.
Overview
Aligns remote config sync with the
/v1/configAPI: the endpoint path moves from/v2/config, andBackend.getRemoteConfig/RemoteConfigManager.refreshRemoteConfignow takeappUserIDand sendapp_user_idin the POST body (including first-run requests without a manifest).RemoteConfigManageradds an in-flight guard so overlappingrefreshRemoteConfigcalls are skipped and the same response is not parsed or written to disk multiple times when the backend still fans out callbacks for deduped HTTP. The lock clears on success, error, and 204.Tests and docs/comments are updated for the new path, body fields, and dedupe behavior.
Reviewed by Cursor Bugbot for commit e817f23. Bugbot is set up for automated code reviews on this repo. Configure here.