Skip to content

Guard vendored CRI message handling against null teardown frames - #14908

Merged
cderv merged 2 commits into
mainfrom
copilot/fix-uncaught-typeerror-axe-transport-failclosed
Sep 18, 2026
Merged

cderv merged 2 commits into
mainfrom
copilot/fix-uncaught-typeerror-axe-transport-failclosed

Conversation

Copilot AI commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Welcome to the quarto GitHub repo!

We are always happy to hear feedback from our users.

To file a pull request, please follow these instructions : https://github.com/quarto-dev/quarto-cli?tab=contributing-ov-file

Also, please complete and keep the checklist below.

Description

The vendored Chrome DevTools Protocol client could throw an uncaught TypeError during browser/socket teardown when a WebSocket frame parsed to null. This updates the message handler to ignore null/non-object teardown frames so the axe transport fail-closed path rejects in-flight commands without crashing the test module.

  • Problem

    • dropped-socket teardown frames could reach _handleMessage() as null
    • the existing message.id dereference escaped from the WebSocket event handler as an uncaught error
  • Change

    • add a narrow guard at the top of src/core/cri/deno-cri/chrome.js::_handleMessage
    • leave command-response (message.id) and event (message.method) handling unchanged for well-formed protocol messages
  • Effect

    • connection-teardown noise is ignored
    • normal CDP responses and events keep the existing behavior
```js
_handleMessage(message) {
  if (!message || typeof message !== "object") {
    return;
  }

  if (message.id) {
    ...
```

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR

@posit-snyk-bot

posit-snyk-bot commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Co-authored-by: cderv <6791940+cderv@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix uncaught TypeError in Chrome DevTools Protocol client Guard vendored CRI message handling against null teardown frames Sep 18, 2026
Copilot AI requested a review from cderv September 18, 2026 10:09
@cderv
cderv marked this pull request as ready for review September 18, 2026 11:42
@cderv

cderv commented Sep 18, 2026

Copy link
Copy Markdown
Member

I am merging because it fixes what it should (https://github.com/quarto-dev/quarto-cli/actions/runs/35338223335/job/105577961196) and the test above are failing on main - looking at that in another PR.

@cderv
cderv merged commit 76d3a1e into main Sep 18, 2026
112 of 117 checks passed
@cderv
cderv deleted the copilot/fix-uncaught-typeerror-axe-transport-failclosed branch September 18, 2026 11:42
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.

3 participants