Repository navigation
Stop the Cypress runs in CI from filling the Sentry quota - #928
Merged
Merged
Conversation
The Cypress runs in CI use the dev server, and each run sent 92 to 172 errors to Sentry, tagged as production. Since the PR builds picked up in November, they used up most of the reserved error volume.
When an admin signs out, Firebase cancels the listeners on the admin-only settings with permission_denied, often before the sign-out reaches the sagas that would remove them. Each such sign-out sent four errors to Sentry. A denial while someone is still signed in, and any other cancel, is still reported.
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.
Problem
Sentry warned that 82% of the reserved error volume is used. Almost all of it (4,092 of about 4,110 errors since Nov 10) is one issue, JAVASCRIPT-REACT-75:
permission_denied at /settings/{movementRetentionDays,messageRetentionDays,customsSelfDeclarationEmails,customsSyncStatus}.None of these events come from a deployed site. All of them have the URL
http://0.0.0.0:8080/, which is the dev server the "Build and test on PR" workflow starts forcy:testandcy:test:api. Each CI run sent exactly 92 errors, and 172 sincecy:test:apiwas added on Nov 19. They were taggedproductionbecauseSentry.initreported from every build.The errors come from the admin-only settings watchers (
watchSettingWhileAdmin). Every Cypress spec signs an admin in and out in itsbefore()hook. On sign-out, Firebase cancels the four admin listeners withpermission_deniedbefore the sagas remove them, and the cancel callback sent each one to Sentry.Changes
Sentry.initnow hasenabled: !__DEV__. Onlynpm startsetsDEV(and Cypress uses it), sonpm run build, i.e. the deployed test and production sites, still report.PERMISSION_DENIEDand nobody is signed in any more. To check that,util/firebasegets a smallisSignedIn()helper. A denial while someone is still signed in, and any other kind of cancel, is still reported.CI builds each PR branch's own code, so other open branches keep sending these errors until they include this change.
Verification
npm test: 357 suites, 7,910 tests pass (new tests forisSignedInand for the two cancel cases)npm run typecheck: no errorsGenerated by Claude Code