Repository navigation
Commit 75add35
committed
fix(webview): drop a caller-supplied viewStates map at the settings write boundary
The registered viewStates map is host-owned: ClineProvider rewrites it from a full read
(savePersistedViewState, clearPersistedViewState, prunePersistedViewStates), so a map handed
in through a settings write - the webview newTask taskConfiguration, or the extension API's
createTask configuration - replaced every other view's durable selection in one write, and an
explicit unset erased the map outright. Entries arriving that way are validated nowhere on
the path, so the key is dropped rather than sanitised; the rest of the settings object is the
caller's to set. mode, currentApiConfigName and apiConfiguration are untouched: those are the
acting view's own selections and already route through the per-view buffer.
The generic updateSettings loop writes through ContextProxy directly, bypassing setValues, so
it drops the same key before any side effect is run for it. provider.setValue is not guarded:
the only handler caller of it passes defaultModeSlug, measured at the call site.
Tests: ClineProvider.spec.ts pins the setValues door against a seeded sibling entry, and
webviewMessageHandler.spec.ts pins the updateSettings door. Both are red at a639813 without
the guards - the crafted map replaced the seeded one, and the loop called
contextProxy.setValue("viewStates", ...) - and green with them.
Lanes at this head: ClineProvider 475, webviewMessageHandler 175, sticky-mode 29,
sticky-profile 25, ContextProxy 64, importExport 55, api-start-new-task 6, api-start-task-
logging 8, all passing. Lint, check-types, code-qa-ci, solheim-smoke and agent-evals types,
lifecycle and webview-recovery model-checks, and the MCP OAuth check are green; the two
solheim record.sh suites need ffprobe (absent here) and config.test.ts asserts POSIX path
separators, so those two are box-local only.1 parent a639813 commit 75add35
4 files changed
Lines changed: 71 additions & 0 deletions
File tree
- src/core/webview
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5553 | 5553 | | |
5554 | 5554 | | |
5555 | 5555 | | |
| 5556 | + | |
| 5557 | + | |
| 5558 | + | |
| 5559 | + | |
| 5560 | + | |
| 5561 | + | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
| 5566 | + | |
| 5567 | + | |
| 5568 | + | |
5556 | 5569 | | |
5557 | 5570 | | |
5558 | 5571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9019 | 9019 | | |
9020 | 9020 | | |
9021 | 9021 | | |
| 9022 | + | |
| 9023 | + | |
| 9024 | + | |
| 9025 | + | |
| 9026 | + | |
| 9027 | + | |
| 9028 | + | |
| 9029 | + | |
| 9030 | + | |
| 9031 | + | |
| 9032 | + | |
| 9033 | + | |
| 9034 | + | |
| 9035 | + | |
| 9036 | + | |
| 9037 | + | |
| 9038 | + | |
| 9039 | + | |
| 9040 | + | |
| 9041 | + | |
| 9042 | + | |
| 9043 | + | |
| 9044 | + | |
| 9045 | + | |
9022 | 9046 | | |
9023 | 9047 | | |
9024 | 9048 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2116 | 2116 | | |
2117 | 2117 | | |
2118 | 2118 | | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
2119 | 2141 | | |
2120 | 2142 | | |
2121 | 2143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
785 | 797 | | |
786 | 798 | | |
787 | 799 | | |
| |||
0 commit comments