Repository navigation
fix(sentry): stop reporting Monaco cancellations when an editor closes - #332
Merged
Merged
Conversation
Monaco drops the promise from its word highlighter delay. When an editor is disposed during that delay, the promise rejects with "Canceled" and Angular sends it to the error handler. The handler now ignores Monaco cancellations, as VS Code does. Fixes BACKOFFICE-4V Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Deployment failed for project backoffice with the following error: Learn More: https://vercel.com/placeos?upgradeToPro=build-rate-limit |
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.
Sentry reported an unhandled
Canceled: Cancelederror on the zone metadata page (BACKOFFICE-4V). It occurs when a user clicks in a metadata editor and then closes the block in less than 50 ms.Monaco's word highlighter starts a 50 ms delay and does not keep the promise. When the editor is disposed during that delay, Monaco cancels the promise. Nothing handles the rejection, so Angular sends it to our error handler. The error is a normal cancellation, not a failure.
SentryReportingErrorHandlernow ignores errors that match Monaco's ownisCancellationErrorcheck (nameandmessageare bothCanceled). VS Code ignores them in the same way.Proof: I ran the dev server with the mock backend and used Playwright in Chromium to click in the editor and then click the block header about 12 ms later. Before the fix, 5 of 5 runs logged the same
Canceledstack as Sentry. After the fix, no runs logged it. A new unit test fails without the fix. Lint, all 1085 unit tests and the production build pass.Fixes BACKOFFICE-4V
Reviewed with sol-loop: 1 round with gpt-6.1-sol on high. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code). Reviewed by GPT-6.1 Sol in Codex.
🤖 Generated with Claude Code