inspector/clients/tui/__tests__
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall 463227c947 fix(auth): make snapshot-and-clear one atomic storage step (#2144)
Copilot review round 18. Three of its findings were the same check-then-act:
`planOAuthRevocation` is asynchronous, so the gap between its reads and the
following `storage.clear()` is still a window — shorter than the network one
closed in round 13, but the same shape. An OAuth completion landing at any of
those awaits saved a grant the clear then destroyed.

`OAuthStorage.takeRevocationSnapshot(serverUrl)` reads what revocation needs
and clears the server in ONE synchronous pass over the in-memory state, with
the persist after the mutation. `clearAndPlanRevocation` replaces
`planOAuthRevocation`, and there is no separate `clear` call left in any
caller — the clear cannot be forgotten or reordered.

The snapshot returns values unparsed, deliberately: schema validation is pure
and belongs after the mutation, since running it inside would reintroduce the
`await` this exists to remove.

Two consequences worth naming. A failure of the take-and-clear now REJECTS
rather than returning an outcome, because the state was not cleared and the
caller's contract is that it was; both clients already have a rejection path.
And cross-process atomicity is explicitly not claimed — nothing in this store
takes a lock, every mutation is a read-modify-write over a loaded snapshot, and
`clear` alone always had that property.

Also from round 18:

- The CLI's budget check ran before considering `plan.outcome`, so a key that
  needed no network was reported as budget-exhausted — warning that a grant may
  be live when that key held none.
- A disconnect failure after a successful clear was reported as "could not
  clear OAuth state" in both clients. It now goes to the disconnect channel,
  and the success is still reported.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177mPHAdECD18nLLCTwR5rh
Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-28 07:40:52 -04:00
..
helpers feat: allow complex JSON values in request _meta 2026-08-23 12:23:40 -04:00
App.test.tsx fix(auth): make snapshot-and-clear one atomic storage step (#2144) 2026-08-28 07:40:52 -04:00
AuthTab.test.tsx fix: close three stale-completion holes from the round-16 suppressed block (#2144) 2026-08-28 06:47:31 -04:00
DetailsModal.test.tsx test(tui): extend coverage gate to Ink components + App.tsx (closes #1501) (#1538) 2026-06-29 08:19:12 -04:00
HistoryTab.test.tsx test(cli,tui): typecheck the __tests__ dirs (#1791) (#1799) 2026-07-27 12:05:35 -04:00
InfoTab.test.tsx chore: close quality-gate coverage gaps (#1689) (#1766) 2026-07-24 17:20:12 -04:00
logger.test.ts test: raise per-file coverage gate to 90 across all clients (closes #1271) (#1532) 2026-06-27 15:26:03 -04:00
NotificationsTab.test.tsx Fixed tab naming to correspond to the web client. (#1780) 2026-07-25 20:11:52 -04:00
oauthDisplay.test.ts Guided-auth removal, OAuth smoke testing, and TUI/CLI support (#1531) 2026-06-29 15:35:51 -04:00
oauthMessageTone.test.ts fix(auth): read enumerated issuers exactly, and stop the TUI tone going stale (#2144) 2026-08-28 02:58:04 -04:00
openUrl.test.ts test(cli,tui): add in-process source coverage gates (#1484) (#1502) 2026-06-20 15:05:58 -04:00
promptArgsToForm.test.ts test(cli,tui): add in-process source coverage gates (#1484) (#1502) 2026-06-20 15:05:58 -04:00
PromptsTab.test.tsx SDK v2 migration (behavior-neutral, versionNegotiation: 'legacy') (#1624) 2026-07-15 10:44:24 -04:00
PromptTestModal.test.tsx SDK v2 migration (behavior-neutral, versionNegotiation: 'legacy') (#1624) 2026-07-15 10:44:24 -04:00
RequestsTab.test.tsx Fixed tab naming to correspond to the web client. (#1780) 2026-07-25 20:11:52 -04:00
ResourcesTab.test.tsx SDK v2 migration (behavior-neutral, versionNegotiation: 'legacy') (#1624) 2026-07-15 10:44:24 -04:00
ResourceTestModal.test.tsx fix: honor a defined-but-empty value, and announce the expansion error 2026-08-16 23:08:30 -04:00
schemaToForm.test.ts fix: address Copilot review round 41 — const does not demand a property, required-only branches 2026-08-26 16:08:24 -04:00
SelectableItem.test.tsx test(tui): extend coverage gate to Ink components + App.tsx (closes #1501) (#1538) 2026-06-29 08:19:12 -04:00
setup.ts test(tui): extend coverage gate to Ink components + App.tsx (closes #1501) (#1538) 2026-06-29 08:19:12 -04:00
Tabs.test.tsx Fixed tab naming to correspond to the web client. (#1780) 2026-07-25 20:11:52 -04:00
ToolsTab.test.tsx feat: flag unportable tool schemas in all three clients 2026-08-25 01:18:53 -04:00
ToolTestModal.test.tsx fix: address Copilot review round 9 — canonical constant comparison, name-based inference, permissive schemas 2026-08-26 04:07:50 -04:00
tsupConfig.test.ts chore(lint): enable no-floating-promises in all five ESLint scopes 2026-08-16 20:57:32 -04:00
tui-servers.test.ts Guided-auth removal, OAuth smoke testing, and TUI/CLI support (#1531) 2026-06-29 15:35:51 -04:00
tui.test.ts Fixed tab naming to correspond to the web client. (#1780) 2026-07-25 20:11:52 -04:00
tuiOAuth.test.ts test(cli,tui): typecheck the __tests__ dirs (#1791) (#1799) 2026-07-27 12:05:35 -04:00
uriTemplateToForm.test.ts fix: dedupe a repeated name in a group, and name every unmet requirement 2026-08-17 00:33:52 -04:00
useSelectableList.test.tsx test(tui): extend coverage gate to Ink components + App.tsx (closes #1501) (#1538) 2026-06-29 08:19:12 -04:00