Skip to content

Commit d86a797

Browse files
committed
address bugbot comment
1 parent 2879ab6 commit d86a797

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

apps/sim/app/workspace/[workspaceId]/providers/workspace-permissions-provider.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ export function WorkspacePermissionsProvider({ children }: WorkspacePermissionsP
7575
removeNotification(reconnectingNotificationIdRef.current)
7676
reconnectingNotificationIdRef.current = null
7777
}
78+
79+
return () => {
80+
if (reconnectingNotificationIdRef.current) {
81+
removeNotification(reconnectingNotificationIdRef.current)
82+
reconnectingNotificationIdRef.current = null
83+
}
84+
}
7885
}, [isReconnecting, isOfflineMode, addNotification, removeNotification])
7986

8087
useEffect(() => {

apps/sim/app/workspace/providers/socket-provider.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,16 @@ interface SocketContextType {
6767
blockId: string,
6868
subblockId: string,
6969
value: any,
70-
operationId?: string
70+
operationId: string | undefined,
71+
workflowId: string
72+
) => void
73+
emitVariableUpdate: (
74+
variableId: string,
75+
field: string,
76+
value: any,
77+
operationId: string | undefined,
78+
workflowId: string
7179
) => void
72-
emitVariableUpdate: (variableId: string, field: string, value: any, operationId?: string) => void
7380

7481
emitCursorUpdate: (cursor: { x: number; y: number } | null) => void
7582
emitSelectionUpdate: (selection: { type: 'block' | 'edge' | 'none'; id?: string }) => void
@@ -685,13 +692,9 @@ export function SocketProvider({ children, user }: SocketProviderProps) {
685692
blockId: string,
686693
subblockId: string,
687694
value: any,
688-
operationId?: string,
689-
workflowId?: string
695+
operationId: string | undefined,
696+
workflowId: string
690697
) => {
691-
if (!workflowId) {
692-
logger.error('emitSubblockUpdate called without workflowId', { blockId, subblockId })
693-
return
694-
}
695698
if (!socket) {
696699
logger.warn('Cannot emit subblock update: no socket connection', { workflowId, blockId })
697700
return
@@ -709,11 +712,13 @@ export function SocketProvider({ children, user }: SocketProviderProps) {
709712
)
710713

711714
const emitVariableUpdate = useCallback(
712-
(variableId: string, field: string, value: any, operationId?: string, workflowId?: string) => {
713-
if (!workflowId) {
714-
logger.error('emitVariableUpdate called without workflowId', { variableId, field })
715-
return
716-
}
715+
(
716+
variableId: string,
717+
field: string,
718+
value: any,
719+
operationId: string | undefined,
720+
workflowId: string
721+
) => {
717722
if (!socket) {
718723
logger.warn('Cannot emit variable update: no socket connection', { workflowId, variableId })
719724
return

0 commit comments

Comments
 (0)