Skip to content

fix(settings): stop reporting expected pairing channel closes to Sentry - #21157

Open
dschom wants to merge 1 commit into
mainfrom
fxa-14444
Open

fix(settings): stop reporting expected pairing channel closes to Sentry#21157
dschom wants to merge 1 commit into
mainfrom
fxa-14444

Conversation

@dschom

@dschom dschom commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Because

  • PairingChannelClient.open() reported every connect failure to Sentry, but a dropped socket is the channel server's normal answer for a channel it will not serve.
  • The mobile supplicant hits that on its post-pairing reload — a path the integration already ignores — and on any webview network change.
  • Triage already tracks "WebSocket unexpectedly closed" as known client-side noise.

This pull request

  • Classifies a closed socket during connect and dispatches CONNECTION_CLOSED (errno 1006) rather than capturing an exception.
  • Leaves every other connect failure reporting to Sentry.
  • Logs the suppressed close as a console breadcrumb.
  • Adds tests for both sides of the split.

Issue that this pull request solves

Closes: FXA-14444

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

  • 6 of the deleted lines are prettier churn the pre-commit hook applied to pre-existing formatting in the same file.
  • create() on the authority side still reports closed sockets; this ticket is scoped to open().
  • FXA-14483 (stacked PR) fixes two further defects in the same catch block.

Because:

- A dropped socket is the channel server's normal answer for a
  channel it will not serve, but open() reported every connect
  failure to Sentry.
- The supplicant hits it on its post-pairing reload, where the
  integration already ignores it, and on any webview network change.
- Triage already tracks "WebSocket unexpectedly closed" as known
  client-side noise.

This commit:

- Classifies a closed socket during connect and dispatches
  CONNECTION_CLOSED rather than capturing an exception.
- Leaves every other connect failure reporting to Sentry.
- Logs the suppressed close as a console breadcrumb.
- Covers both branches in pairing-channel.test.ts.

Closes #FXA-14444
@dschom
dschom marked this pull request as ready for review September 4, 2026 23:53
@dschom
dschom requested a review from a team as a code owner September 4, 2026 23:53
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.

1 participant