inspector/clients/web/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall 1939136eff fix: read template variables as own properties only
Addresses Copilot's round-6 review on #2035.

`toString`, `constructor`, `valueOf` and `__proto__` are all valid RFC
6570 variable names -- `varname` allows ALPHA / DIGIT / `_` / pct-encoded
-- and every lookup here was a bare `values[name]`, which finds
`Object.prototype`'s member for each of them. Measured: `({})["toString"]
!== undefined` is true with typeof "function", and `({}["constructor"] ??
"").length` is 1.

So a *blank* `{?toString}` field read as supplied and expanded a function
body into the URI instead of omitting the expression, and
`hasRequiredValues([["constructor"]], {})` returned true because
`Object.length` is 1 -- a required group satisfied by nothing.

All reads now go through an own-property `readValue`, and the web
preview's filled-check uses `Object.hasOwn`. `expandExpression` carries
the value through its filter rather than re-reading it afterwards, so the
"is it defined" test and the read cannot disagree and nothing needs a
non-null assertion.

The remaining six findings were documentation drifting behind the code,
which matters here because the comments are the argument for why this
module exists:

- The web helper still described the SDK's second-`?`-to-`&` rewrite as
  something the preview relies on. That was removed last round.
- Three places still named the CLI as a consumer. It has no template form
  and passes an already-expanded `--uri` to `readResource`.
- The PR description still described the superseded architecture
  (expansion delegated to the SDK), i.e. the opposite of what now ships.

Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-16 22:02:39 -04:00
..
components fix: encode per RFC 3986, and derive the TUI form from the shared parser 2026-08-16 21:04:20 -04:00
hooks chore(deps): migrate to eslint 10 to clear the brace-expansion DoS advisory (#1900) 2026-08-01 20:13:30 -04:00
lib refactor(web): sharpen the src/lib vs src/utils rule and move misfiled modules (#1784) 2026-07-25 22:24:30 -04:00
test fix: read template variables as own properties only 2026-08-16 22:02:39 -04:00
theme chore: close a batch of quality-gate & tidy gaps (#1785 #1787 #1789 #1790 #1767) (#1792) 2026-07-26 10:43:11 -04:00
types chore: close a batch of quality-gate & tidy gaps (#1785 #1787 #1789 #1790 #1767) (#1792) 2026-07-26 10:43:11 -04:00
utils fix: read template variables as own properties only 2026-08-16 22:02:39 -04:00
App.css refactor(web): sweep AGENTS.md TypeScript + Mantine rule violations (#1771) 2026-07-25 11:38:49 -04:00
App.test.tsx fix: salvage a list result's valid entries when one is malformed (#1909) 2026-08-15 16:52:11 -04:00
App.tsx Merge branch 'v2/main' into v2/fix/1909-salvage-malformed-list-items 2026-08-15 23:05:31 -04:00
index.ts feat: port CLI, TUI, and launcher from v1.5 into v2 (#1452) 2026-06-14 20:27:49 -04:00
main.tsx fix(web): remove mantine-border-animate, use green highlight border (#1536) 2026-06-27 17:04:25 -04:00