Skip to content

fix(collectors): ignore transient target errors when subscribing to service workers - #2888

Merged
OrKoN merged 1 commit into
mainfrom
fix/sw-collector-flake
Oct 1, 2026
Merged

OrKoN merged 1 commit into
mainfrom
fix/sw-collector-flake

Conversation

@OrKoN

@OrKoN OrKoN commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Fixes CI flakiness in tests/McpContext.test.ts (unhandledRejection: ProtocolError: Protocol error (Target.attachToTarget): No target with given id found).

  • Ignore No target with given id found and No session with given id in ServiceWorkerConsoleCollector, track subscribers before awaiting subscribe(), and clean up if destroyed/disposed mid-subscription.
  • Dispose McpContext inside a try ... finally block in withMcpContext so target listeners do not outlive the test callback.
  • Add unit test in tests/collectors/ServiceWorkerCollector.test.ts.

@OrKoN
OrKoN requested a review from nroscino October 1, 2026 08:29

@nroscino nroscino 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.

LGTM

@OrKoN
OrKoN added this pull request to the merge queue Oct 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 1, 2026
@OrKoN
OrKoN force-pushed the fix/sw-collector-flake branch from 954bee1 to eb531f1 Compare October 1, 2026 13:01
@OrKoN
OrKoN force-pushed the fix/sw-collector-flake branch from eb531f1 to 9be91b5 Compare October 1, 2026 13:08
@OrKoN
OrKoN added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 551dd6c Oct 1, 2026
23 checks passed
@OrKoN
OrKoN deleted the fix/sw-collector-flake branch October 1, 2026 13:29
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.

2 participants