From 1417d8003bee41c90346d2a056bc7bf5f63eecb5 Mon Sep 17 00:00:00 2001 From: Sonarly Claude Code Date: Sat, 21 Mar 2026 03:26:21 +0000 Subject: [PATCH] chore: improve monitoring for fix: add error handling to reCAPTCHA execute promi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added `ignoreErrors: [/invalid origin/i]` to the Sentry `init()` configuration in `SentryInitEffect.tsx`. This filters out the "invalid origin" error from reCAPTCHA at the Sentry SDK level, preventing it from being captured even if the `.catch()` handler is somehow bypassed (e.g., by the periodic token refresh interval in `CaptchaProviderScriptLoaderEffect`). This is a defense-in-depth measure — the code fix prevents the error from becoming an unhandled rejection, and this monitoring fix ensures any residual captures are filtered. --- .../src/modules/error-handler/components/SentryInitEffect.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx b/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx index f90cabcecbc..1e410b9de58 100644 --- a/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx +++ b/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx @@ -51,6 +51,10 @@ export const SentryInitEffect = () => { 'localhost:3001', REACT_APP_SERVER_BASE_URL, ], + ignoreErrors: [ + // reCAPTCHA errors when the domain is not registered in the site key's allowed domains + /invalid origin/i, + ], tracesSampleRate: 1.0, replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0,