Skip to content
Merged
Prev Previous commit
Next Next commit
fix(logs): track isFetching reactively and drop empty-list early-return
- Remove  guard that prevented clearing the
  pending ref when filters return no results
- Use  directly in the condition and add it to
  the effect deps so the effect re-triggers after a background refetch
  • Loading branch information
waleedlatif1 committed Mar 31, 2026
commit be5b3dfcd70a9e0ea72f1a48267dde978ab3fd9d
6 changes: 3 additions & 3 deletions apps/sim/app/workspace/[workspaceId]/logs/logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,18 +429,18 @@ export default function Logs() {
}

useEffect(() => {
if (!pendingExecutionIdRef.current || sortedLogs.length === 0) return
if (!pendingExecutionIdRef.current) return
const targetExecutionId = pendingExecutionIdRef.current
const found = sortedLogs.find((l) => l.executionId === targetExecutionId)
if (found) {
pendingExecutionIdRef.current = null
dispatch({ type: 'TOGGLE_LOG', logId: found.id })
} else if (!logsQuery.hasNextPage) {
pendingExecutionIdRef.current = null
Comment thread
waleedlatif1 marked this conversation as resolved.
} else if (!logsQueryRef.current.isFetching) {
} else if (!logsQuery.isFetching) {
logsQueryRef.current.fetchNextPage()
Comment thread
waleedlatif1 marked this conversation as resolved.
}
}, [sortedLogs, logsQuery.hasNextPage])
}, [sortedLogs, logsQuery.hasNextPage, logsQuery.isFetching])

useEffect(() => {
const timers = refreshTimersRef.current
Expand Down
Loading