Repository navigation
Conversation
…r hosts' tokens An older client sends the whole token map when it saves or removes a token, and the server replaced the stored map with it, wiping every other host's token and reference. Tokens now merge per host, so a host missing from the patch keeps what is stored. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
85512de to
8d964d6
Compare
A saved token reference falls back to the sign-in when the vault cannot be read, so the text now says the token is used while it can be read. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
a5f37b5 to
8b437c4
Compare
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Saving a source-control token now preserves other hosts' credentials, while explicit per-host removal and clear-all behavior remain intact. The change is limited to settings merging and explanatory text, without changing permissions or secret-storage protections. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Merge source-control host token patches packages/shared/src/serverSettings.ts, packages/contracts/src/settings.ts, packages/shared/src/serverSettings.test.ts |
Nonempty token maps merge with saved tokens. Host keys are trimmed and lowercased. Empty maps clear tokens, while omitted token fields preserve saved tokens. The contract comment documents these rules, and tests cover host-token retention and normalized duplicate keys. |
Update saved-token subtitle apps/web/src/components/settings/SourceControlAppSignInSettings.tsx |
The subtitle says the saved token is used while it can be read. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge, maria-rcks
Merge Risk: 
Minimal · up to 65d2a
-
The token patch behavior and sign-in guidance match the intended contract, with no merge-blocking risk identified.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description includes all required sections and clearly explains the problem, implementation, scope, approval reference, verification results, and the untested live older-client scenario. It does not include before-and-after screenshots for the UI text change, but the description is otherwise complete and focused.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Dismissing prior approval to re-evaluate 65d2ad1
|
Note Written by Verified in a real dev environmentVerified unchanged head On Also exercised current-client Save and Remove, trimmed/mixed-case host keys, redaction-marker round trips, a host settings patch without tokens, and clear-all with Created a project for the real checkout through the app. A real Codex Short runtime transcript, with credential values omitted: Blacksmith passed all 113 focused shared/settings/secret-lifecycle tests. Before, on main after the partial save: After, on the PR with the same hosts: Save, remove, and partial-save interaction. Inspected the capture and verified uploaded playback and seeking in T3's browser: Not verified
|




Problem
An older client that saves or removes any source control token wipes every other saved token. It sends the whole token map, the server replaced the stored map with it, and the result drops every other host's literal token and secret reference. An older desktop app (which bundles its own web client) connected to a newer remote server hits this.
Change
The server now merges
tokensper host when applying a source control host settings patch. A host missing from the patch keeps its saved value. Removing a token still works: the current client sends""for it, and that is stored as before. An emptytokensmap still clears every token for the host kind.The sign-in text in Settings said a saved token is used "until you remove it". A saved reference falls back to the sign-in when the vault can't be read, so it now says "while it can be read".
Scope and approval
Follow-up to #27756, which noted this as "fix before the flag goes on". It is one server-side merge in
packages/shared/src/serverSettings.ts, plus one line of sign-in text in the web settings. No contract change.Verification
packages/shared/src/serverSettings.test.tsthat patchestokens: { "ghe.example": "x" }over a savedgithub.comsecret reference and expects both to remain. It fails onmainand passes with the fix.tokensmap clears all) caught a first version that merged an empty map as a no-op; the merge now applies only to a non-empty map.apps/serverserverSettings and sourceControlHostSecrets tests pass.vp run check:changedpasses (format, lint, knip, typecheck, tests).applyServerSettingsPatchthrough save, older-client save, and""clear: the reference and literal tokens survive the older-client save, and""still clears a host.