Repository navigation
Commit c189c0e
fix(api): tolerate a corrupted stored mimoBaseUrl and truth the write-path comment
What: isStoredMimoBaseUrlOffList now reads the stored value as `unknown` and
treats any non-string as off-list (purge) instead of passing it to
stripTrailingSlashes, which threw TypeError on `.endsWith` and rejected the
whole setConfiguration write. Adds two spec rows: a stored allowlisted URL
carrying a trailing slash survives a partial update, and non-string stored
values (42, an object, true) resolve to a purge rather than a rejection. The
setConfiguration leading comment no longer claims this is the only write path.
Why: the helper exists precisely because storage can hold values no schema
ever saw, so a corrupted value must not be a new failure mode of the fix. The
trailing-slash row pins the stripTrailingSlashes guard: only the slash-less
literal is on the allowlist, so dropping the strip would purge every such
cluster and silently drop the user to the default SGP endpoint. The comment
was stale after review confirmed ClineProvider.createTask persists a
caller-supplied configuration through setValues with no allowlist, which makes
the consumers' fail-closed checks load-bearing rather than redundant.
Impact: a corrupted mimoBaseUrl in storage is cleared on the next
setConfiguration instead of breaking it; behavior for valid, off-list, empty
and unset stored values is unchanged. No production behavior change from the
two spec rows or the comment.
Co-Authored-By: Claude <[email protected]>1 parent e0a73f1 commit c189c0e
2 files changed
Lines changed: 64 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
225 | 263 | | |
226 | 264 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
641 | 647 | | |
642 | 648 | | |
643 | 649 | | |
| |||
670 | 676 | | |
671 | 677 | | |
672 | 678 | | |
673 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
674 | 685 | | |
675 | 686 | | |
676 | 687 | | |
677 | 688 | | |
678 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
679 | 694 | | |
680 | 695 | | |
681 | 696 | | |
| |||
0 commit comments