Compare commits

...
Author SHA1 Message Date
Sonarly Claude CodeandClaude Opus 4.6 7740127ae2 Fix: Skip Sentry capture for expected EVENT_STREAM_ALREADY_EXISTS SSE error
The next callback in useTriggerEventStreamCreation was reporting all SSE
subscription errors to Sentry, including the known/expected
EVENT_STREAM_ALREADY_EXISTS condition. The message handler already
correctly checks for this subCode and handles it gracefully, but the
next callback was firing too and creating noise in Sentry.

Add the same EVENT_STREAM_ALREADY_EXISTS subCode check to the next
callback so this expected error only triggers the stream destroy flow
without being captured as an exception.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-19 01:36:08 +00:00
@@ -83,11 +83,16 @@ export const useTriggerEventStreamCreation = () => {
}>,
) => {
if (isDefined(value?.errors)) {
captureException(
new Error(
`SSE subscription error: ${value.errors[0]?.message}`,
),
);
const subCode = value.errors[0]?.extensions?.subCode;
if (subCode !== 'EVENT_STREAM_ALREADY_EXISTS') {
captureException(
new Error(
`SSE subscription error: ${value.errors[0]?.message}`,
),
);
}
set(shouldDestroyEventStreamState, true);
return;