Skip to content

fix(webview): preview-only logging for rejected host messages#227

Merged
mtskf merged 1 commit into
mainfrom
fix/webview-rejected-log-preview
Jul 16, 2026
Merged

fix(webview): preview-only logging for rejected host messages#227
mtskf merged 1 commit into
mainfrom
fix/webview-rejected-log-preview

Conversation

@mtskf

@mtskf mtskf commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • subscribeToHost in src/webview/host.ts logged the full rejected inbound payload on validator-rejection, unlike the host-side precedent (quoll-editor-panel.ts's handleInbound) which previews only type + top-level keys.
  • Aligned the webview's generic validator-rejection branch to log the same type/keys preview instead of the raw payload, so an unvalidated message can't leak arbitrary content to the console.

Changes

  • src/webview/host.ts: replace console.error(..., event.data) with a { type, keys } preview in the validator-rejection branch.
  • test/webview/host.test.ts: strengthen the existing "shapeless payload" test to assert the preview shape and that a sensitive field value never reaches the logged output.

Related

  • TODO: Align webview rejected-message logging to preview-only (Fable full review 2026-07-17)

Test Plan

  • pnpm compile
  • pnpm test:unit
  • pnpm lint (no findings in touched files)

The validator-rejection branch in subscribeToHost logged the full
event.data payload to the console. Align it with the host-side
precedent in quoll-editor-panel.ts (handleInbound), which previews
only type + top-level keys instead of leaking arbitrary payload
content.
@mtskf
mtskf merged commit d820c2c into main Jul 16, 2026
1 check passed
@mtskf
mtskf deleted the fix/webview-rejected-log-preview branch July 16, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant