Skip to content

Commit

Permalink
Send Sentry error on onCloseConnection of a whiteboard (#7576)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbykolev authored Jan 30, 2025
1 parent 3121963 commit 94307ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/apollo/graphqlLinks/httpLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const httpLink = (graphQLEndpoint: string, enableWebSockets: boolean) =>
uploadLink
);
} catch (error) {
logWarn(error as Error, { category: TagCategoryValues.WS });
logWarn(error as Error, { category: TagCategoryValues.WS, label: 'Failed to create ws link' });
}
}
return uploadLink;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface WhiteboardDetails {
preview?: {
id: string;
} & PreviewImageDimensions;
url?: string;
};
createdBy?: {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import useWhiteboardDefaults from './useWhiteboardDefaults';
import Loading from '@/core/ui/loading/Loading';
import { Identifiable } from '@/core/utils/Identifiable';
import { lazyWithGlobalErrorHandler } from '@/core/lazyLoading/lazyWithGlobalErrorHandler';
import { TagCategoryValues, error as logError } from '@/core/logging/sentry/log';

const FILE_IMPORT_ENABLED = true;
const SAVE_FILE_TO_DISK = true;
Expand Down Expand Up @@ -73,7 +74,7 @@ const useActorWhiteboardStyles = makeStyles(theme => ({
}));

export interface WhiteboardWhiteboardEntities {
whiteboard: Identifiable | undefined;
whiteboard: (Identifiable & { profile?: { url?: string } }) | undefined;
filesManager: WhiteboardFilesManager;
lastSavedDate: Date | undefined;
}
Expand Down Expand Up @@ -165,6 +166,12 @@ const CollaborativeExcalidrawWrapper = ({
if (isOnline) {
setupReconnectTimeout();
}
// event if it's duplicated by the httpLink and Portal handlers, let's log this closeConnection one
// with additional info here #7492
logError('WB Connection Closed', {
category: TagCategoryValues.WHITEBOARD,
label: `WB ID: ${whiteboard?.id}; URL: ${whiteboard?.profile?.url}; Online: ${isOnline}`,
});
},
onInitialize: collabApi => {
combinedCollabApiRef.current = collabApi;
Expand Down

0 comments on commit 94307ac

Please sign in to comment.