Repository navigation
fix(sentry): drop benign closed-channel postMessage error on client - #217
Merged
Merged
Conversation
nuxt-skew-protection's multi-tab plugin closes its BroadcastChannel on app:error, and a version update already in flight can still post to it. Chrome rejects that post with InvalidStateError (SKILLD-12). The tab is erroring or closing anyway, so the event is noise. The client beforeSend now drops that exact message and keeps every other error. Claude-Session: https://claude.ai/code/session_01AkTC7eqkf2tpVZJhYDU2YL
Contributor
🤖 MERGED
GitHub merged this pull request. No material findings were recorded. 781c1417-0fbc-42eb-8765-c195da2d0932 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Closes #174
❓ Type of change
📚 Description
Client Sentry reports a benign tab-close race as an unhandled error (SKILLD-12). nuxt-skew-protection's multi-tab plugin closes its
BroadcastChannelonapp:error. A version update that is already in flight can still post to the closed channel, and Chrome rejects the post:The client config now has a
beforeSendthat drops this one message. It uses the same shape as the server plugin: it checkshint.originalExceptionand the serialized exception values. The newisClosedBroadcastChannelErrorpredicate inshared/sentry.tsmatches the exact message from the latest Sentry event, so these still reach Sentry:postMessageon another target, such as aWorkerDataCloneErrorfrom the sameBroadcastChannelInvalidStateErrorThe only events in Sentry come from Chrome. Firefox and Safari word the error differently, so they are not matched. If they start to show up, add their exact messages.
Checks:
pnpm vitest run test/unit/sentry-cache-write-filter.test.tspasses 17 tests, 4 of them new. The new tests failed before the fix.pnpm typecheckand eslint on the 3 files exit 0.https://claude.ai/code/session_01AkTC7eqkf2tpVZJhYDU2YL