Skip to content

Commit 8c0fe13

Browse files
waleedlatif1claude
andcommitted
fix(mothership): eagerly update messageQueueRef in removeFromQueue
Match the pattern used by sendNow and editQueuedMessage — update the ref synchronously so finalize's microtask cannot read a stale queue and drain a message the user just removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 71a83af commit 8c0fe13

File tree

1 file changed

+1
-0
lines changed
  • apps/sim/app/workspace/[workspaceId]/home/hooks

1 file changed

+1
-0
lines changed

apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ export function useChat(
10111011
}, [invalidateChatQueries, persistPartialResponse, executionStream])
10121012

10131013
const removeFromQueue = useCallback((id: string) => {
1014+
messageQueueRef.current = messageQueueRef.current.filter((m) => m.id !== id)
10141015
setMessageQueue((prev) => prev.filter((m) => m.id !== id))
10151016
}, [])
10161017

0 commit comments

Comments
 (0)