Skip to content

refactor(remote-config): /v1/config path, app_user_id body, refresh dedupe#3648

Merged
tonidero merged 1 commit into
mainfrom
remote_config_v1_path_app_user_id_and_refresh_dedupe
Jun 25, 2026
Merged

refactor(remote-config): /v1/config path, app_user_id body, refresh dedupe#3648
tonidero merged 1 commit into
mainfrom
remote_config_v1_path_app_user_id_and_refresh_dedupe

Conversation

@tonidero

@tonidero tonidero commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description

3 main changes here:

  • Changed to use /v1/config instead of /v2/config
  • Add app_user_id to request body for config
  • Avoid performing multiple requests simultaneously (or even with the backend dedupe, avoid the parsing and storage multiple times)

Note

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/config API: the endpoint path moves from /v2/config, and Backend.getRemoteConfig / RemoteConfigManager.refreshRemoteConfig now take appUserID and send app_user_id in the POST body (including first-run requests without a manifest).

RemoteConfigManager adds an in-flight guard so overlapping refreshRemoteConfig calls 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.

Copy link
Copy Markdown
Contributor Author

@tonidero tonidero marked this pull request as ready for review June 25, 2026 10:01
@tonidero tonidero requested a review from a team as a code owner June 25, 2026 10:01

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ 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
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e817f23. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ignoring for now. We might want to cancel the old request in that case but that can be done separately.

@tonidero tonidero marked this pull request as draft June 25, 2026 10:04
…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>
@tonidero tonidero force-pushed the remote_config_v1_path_app_user_id_and_refresh_dedupe branch from e817f23 to f070e8c Compare June 25, 2026 10:18
@tonidero tonidero marked this pull request as ready for review June 25, 2026 10:24

@rickvdl rickvdl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

@tonidero tonidero added this pull request to the merge queue Jun 25, 2026
Merged via the queue into main with commit 2c4a243 Jun 25, 2026
35 checks passed
@tonidero tonidero deleted the remote_config_v1_path_app_user_id_and_refresh_dedupe branch June 25, 2026 11:39
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