Skip to content

fix(sentry): Register SentryGlobalFilter via dependency injection#20017

Merged
vpomerleau merged 1 commit intomainfrom
FXA-13031
Feb 9, 2026
Merged

fix(sentry): Register SentryGlobalFilter via dependency injection#20017
vpomerleau merged 1 commit intomainfrom
FXA-13031

Conversation

@vpomerleau
Copy link
Copy Markdown
Contributor

Because

  • Manual instantiation of SentryGlobalFilter bypassed NestJS dependency injection
  • This caused applicationRef to be undefined, crashing the exception filter
  • Crashed filter left requests hanging indefinitely (RP event distribution delays spiked to 2.31 days)

This pull request

  • Registers SentryGlobalFilter as APP_FILTER provider in AppModule for fxa-graphql-api, fxa-event-broker, and fxa-admin-server
  • Removes manual app.useGlobalFilters(new SentryGlobalFilter()) calls from main.ts
  • Ensures filter receives HttpAdapterHost via dependency injection

Issue that this pull request solves

Closes: FXA-13031

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).

Screenshots (Optional)

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

Other information (Optional)

Any other information that is important to this pull request.

  Because:

  * SentryGlobalFilter was instantiated without arguments, causing applicationRef to be undefined
  * When exceptions occurred, filter crashed on applicationRef.isHeadersSent()
  * Crashed filter left requests hanging without response, preventing Pub/Sub message acknowledgement
  * Unacked messages caused infinite redelivery loop (RP event distribution delays spiked to 2.31 days)

  This commit:

  * Passes httpAdapter from HttpAdapterHost to SentryGlobalFilter constructor in fxa-graphql-api, fxa-event-broker, and fxa-admin-server
  * Ensures filter can handle exceptions without crashing
  * Allows proper HTTP responses to Pub/Sub push endpoints so messages are acknowledged

Closes #FXA-13031
@dschom dschom marked this pull request as ready for review February 7, 2026 00:43
@dschom dschom requested a review from a team as a code owner February 7, 2026 00:43
@vpomerleau vpomerleau merged commit 135775a into main Feb 9, 2026
20 checks passed
@vpomerleau vpomerleau deleted the FXA-13031 branch February 9, 2026 17:36
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