fix(settings): Skip pairing channel close once the socket is gone - #21152
Open
dschom wants to merge 1 commit into
Open
fix(settings): Skip pairing channel close once the socket is gone#21152dschom wants to merge 1 commit into
dschom wants to merge 1 commit into
Conversation
Because: * A socket error disconnects the pairing channel without a matching `close` event, so the authority tears down still holding a dead channel. * fxa-pairing-channel's `close()` dereferences its already-nulled `_connection`, throwing a TypeError caught only to be reported to Sentry. This commit: * Skips the underlying `close()` in `PairingChannelClient` when the package has already dropped the socket. * Adds a regression test covering close after a socket error. Closes #FXA-14443 Fixes FXA-CONTENT-1KYN
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
close, so theauthority's teardown calls into a dead channel and fxa-pairing-channel's own
close()throws.TypeErrors to Sentry on stage since 27 Aug, crowding out real pairing failures.
TypeErrors in prod since 30 Apr (FXA-CONTENT-1K0J).
This pull request
close()inPairingChannelClientwhenfxa-pairing-channel has already dropped the socket.
Issue that this pull request solves
Closes: FXA-14443
Closes: FXA-14445
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
_connection === nullrather than falsy on purpose. Onlynullmeans the package tore the socket down; if a future version renames orremoves the property it reads as
undefinedand falls through to the existingtry/catch-guarded
close(), rather than silently leaving channels open.pairing-channel.tsandpairing-authority-integration.tscarry leftoverconsole.info/console.warndebug logging from 3155801. Left untouchedhere — worth a separate cleanup.