Skip to content
Merged
Prev Previous commit
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.
  • Loading branch information
waleedlatif1 committed Mar 31, 2026
commit 48bdbe58319a3853993cc277743fee84e37b35f2
2 changes: 1 addition & 1 deletion apps/sim/app/workspace/[workspaceId]/logs/logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export default function Logs() {
dispatch({ type: 'TOGGLE_LOG', logId: found.id })
} else if (!logsQuery.hasNextPage && logsQuery.status === 'success') {
pendingExecutionIdRef.current = null
Comment thread
waleedlatif1 marked this conversation as resolved.
} else if (!logsQuery.isFetching) {
} else if (!logsQuery.isFetching && logsQuery.status === 'success') {
logsQueryRef.current.fetchNextPage()
Comment thread
waleedlatif1 marked this conversation as resolved.
}
}, [sortedLogs, logsQuery.hasNextPage, logsQuery.isFetching, logsQuery.status])
Expand Down
Loading