Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

fix: 正常終了時のWebSocketエラーログを抑制 (suppress shutdown errors) - #233

Open
haranishi wants to merge 1 commit into
cloudflare:mainfrom
haranishi:fix/230-websocket-shutdown-errors
Open

haranishi wants to merge 1 commit into
cloudflare:mainfrom
haranishi:fix/230-websocket-shutdown-errors

Conversation

@haranishi

Copy link
Copy Markdown

正常な browser.close() の終了処理で発生するWebSocketのerrorイベントが、console.errorとして記録される問題を修正します。Browser.closeの送信、transportのclose、WebSocketのcloseイベントで終了状態を記録し、終了処理中のerrorログを抑制します。稼働中のエラーは引き続き記録します。

認証情報や実ブラウザーを必要としない5つの回帰テストと、テスト用CIを追加しました。

Normal browser.close() can emit WebSocket error events during shutdown and create misleading error logs. Track shutdown when sending Browser.close, closing the transport, or receiving a close event, and suppress error logs once shutdown starts. Errors in active sessions remain visible.

Add five credential-free regression tests and a dedicated pull-request workflow.

Validation:

  • Before the fix: three shutdown cases failed; the two active-error cases passed.
  • After the fix: all five unit tests passed (npm run test:unit in packages/playwright-cloudflare/tests).
  • npm run build in packages/playwright-cloudflare passed.
  • ESLint and a TypeScript check of the changed source/test files passed.
  • Remote Browser Run end-to-end tests were not run; regression coverage uses a mock WebSocket.

Closes #230.

@haranishi
haranishi marked this pull request as ready for review October 11, 2026 08:38
Copilot AI balanced review requested due to automatic review settings October 11, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Websocket error" is logged with console.error every time browser.close() ends a session normally

2 participants