Skip to content

Commit 48bdbe5

Browse files
committed
fix(logs): guard fetchNextPage call until query has succeeded
Add logsQuery.status === 'success' to the fetchNextPage branch so it mirrors the clear branch. On mount the query is disabled (isFetching is false, status is pending), causing the effect to call fetchNextPage() before the query is initialized — now both branches require success.
1 parent 1715669 commit 48bdbe5

File tree

1 file changed

+1
-1
lines changed
  • apps/sim/app/workspace/[workspaceId]/logs

1 file changed

+1
-1
lines changed

apps/sim/app/workspace/[workspaceId]/logs/logs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export default function Logs() {
437437
dispatch({ type: 'TOGGLE_LOG', logId: found.id })
438438
} else if (!logsQuery.hasNextPage && logsQuery.status === 'success') {
439439
pendingExecutionIdRef.current = null
440-
} else if (!logsQuery.isFetching) {
440+
} else if (!logsQuery.isFetching && logsQuery.status === 'success') {
441441
logsQueryRef.current.fetchNextPage()
442442
}
443443
}, [sortedLogs, logsQuery.hasNextPage, logsQuery.isFetching, logsQuery.status])

0 commit comments

Comments
 (0)