fix(logs): add status field to log detail API for polling#3405
Merged
waleedlatif1 merged 1 commit intostagingfrom Mar 4, 2026
Merged
fix(logs): add status field to log detail API for polling#3405waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR fixes a bug where the log detail sidebar would never poll for live updates on in-progress executions. The root cause was that the Changes:
Assessment:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Client (logs.tsx)
participant Q as React Query (useLogDetail)
participant API as GET /api/logs/[id]
participant DB as Database
C->>Q: select log (running/pending)
Q->>API: fetch /api/logs/{id}
API->>DB: SELECT id, status, level, ... FROM workflow_execution_logs
Note over DB,API: status field NOW included in SELECT
DB-->>API: row with status = 'running'
API-->>Q: { data: { ..., status: 'running' } }
Q-->>C: data.status = 'running'
Note over C,Q: detailRefetchInterval sees 'running'<br/>→ schedules poll in 3000ms
loop Every 3s while status is running/pending
Q->>API: refetch /api/logs/{id}
API->>DB: SELECT id, status, ...
DB-->>API: row with updated status
API-->>Q: { data: { ..., status: 'completed' } }
Q-->>C: data.status = 'completed'
Note over C,Q: detailRefetchInterval sees 'completed'<br/>→ returns false, stops polling
end
Last reviewed commit: 3eea3c6 |
3eea3c6 to
4241cfe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
statusfield, so the detail sidebar never polled for updates on running/pending logsstatusto the select query and response in/api/logs/[id]Type of Change
Testing
Tested manually
Checklist