Conversation
Because: - fxa-pairing-channel reports an unexpected socket close as an `error`, not a `close`, so the wrapper keeps a channel it has already discarded - sending on that channel threw a raw `TypeError` from the library, which reached Sentry and the integrations' `fail()` handlers with no errno This commit: - throws `CONNECTION_CLOSED` from `PairingChannelClient.send()` when the underlying channel reports itself closed - covers the torn-down send path in the unit tests Closes: FXA-14484
dschom
commented
Sep 4, 2026
| _channelId?: string; | ||
| _channelKey?: Uint8Array; | ||
| /** | ||
| * True once fxa-pairing-channel has torn the WebSocket down. In 1.0.2 this |
Contributor
Author
There was a problem hiding this comment.
Just say 'True once fxa-pairing-channel has torn the WebSocket down.'
dschom
marked this pull request as ready for review
September 4, 2026 23:59
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.
Because
fxa-pairing-channeldispatcheserrorrather thanclose, so the wrapper keeps using a channel the library has already discarded.TypeErrorwith no errno instead of a pairing error the flow could act on.code/stateimmediately after minting it, so the send should refuse a dead socket before handing anything over.This pull request
CONNECTION_CLOSED(errno 1006) fromPairingChannelClient.send()when the underlying channel reports itselfclosed.Issue that this pull request solves
Closes: FXA-14484
Checklist
Put an
xin the boxes that applyHow to review (Optional)
send()guard inpackages/fxa-settings/src/lib/channels/pairing-channel.ts.scope:string), not the fix.closedgetter fromfxa-pairing-channel1.0.2 (!this._socket || readyState === 3). Verified by removing the guard and confirming the new test fails.Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
close()path in the same file. Expect a small conflict on thePairingChannelSockettype if that lands first — fix(settings): Skip pairing channel close once the socket is gone #21152 adds_connection, this adds the publicclosedgetter./fxa-security-reviewcovered this guard on the earlier branch: no Critical or High findings.DECODE_ERROR) is one path that tears the channel down; not fixed here.