Skip to content

Commit 0023e8d

Browse files
Vikhyath MondretiVikhyath Mondreti
authored andcommitted
fix retry mechanism
1 parent 2f726fa commit 0023e8d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

apps/sim/stores/operation-queue/store.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ export const useOperationQueueStore = create<OperationQueueState>((set, get) =>
156156

157157
emitFunction(operation)
158158
retryTimeouts.delete(operationId)
159+
160+
// Create new operation timeout for this retry attempt
161+
const newTimeoutId = setTimeout(() => {
162+
logger.warn('Retry operation timeout - no server response after 5 seconds', {
163+
operationId,
164+
})
165+
operationTimeouts.delete(operationId)
166+
get().handleOperationTimeout(operationId)
167+
}, 5000)
168+
169+
operationTimeouts.set(operationId, newTimeoutId)
159170
}, delay)
160171

161172
retryTimeouts.set(operationId, timeout)
@@ -201,8 +212,6 @@ export const useOperationQueueStore = create<OperationQueueState>((set, get) =>
201212
},
202213

203214
handleSocketReconnection: () => {
204-
logger.info('Socket reconnected - clearing timeouts but keeping operations for retry')
205-
206215
// Clear all timeouts since they're for the old socket
207216
retryTimeouts.forEach((timeout) => clearTimeout(timeout))
208217
retryTimeouts.clear()

0 commit comments

Comments
 (0)