Uh oh!
There was an error while loading. Please reload this page.
fix(tasks): fix sidebar tasks skeleton hanging indefinitely - #4365
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Updates Reviewed by Cursor Bugbot for commit ef80370. Configure here. |
Switch useTasks to skipToken + keepPreviousData and derive tasksLoading from isLoading (isPending && isFetching) instead of data presence. This matches the established useWorkflows pattern and prevents the skeleton from hanging forever on query errors or when workspaceId is temporarily absent.
Greptile SummaryFixes the sidebar tasks skeleton hanging indefinitely by switching Confidence Score: 5/5Safe to merge — the fix is correct and scoped; the only open item is missing error logging described in the PR description. All three changes are logically sound: skipToken correctly prevents isLoading from staying true indefinitely when workspaceId is absent, and the home.tsx guard change handles the loading edge case properly. No P0/P1 issues found. No files require special attention beyond the missing error-logging follow-up in sidebar.tsx. Important Files Changed
Sequence DiagramsequenceDiagram
participant Sidebar
participant useTasks
participant TanStackQuery
participant API
Note over Sidebar,API: Before fix
Sidebar->>useTasks: useTasks(workspaceId?)
useTasks->>TanStackQuery: enabled: Boolean(workspaceId)
Note over TanStackQuery: workspaceId absent OR error → data=undefined forever
TanStackQuery-->>Sidebar: data=undefined → tasksLoading=true ∞
Note over Sidebar,API: After fix
Sidebar->>useTasks: useTasks(workspaceId?)
useTasks->>TanStackQuery: queryFn = skipToken (no workspaceId)
TanStackQuery-->>Sidebar: isLoading=false (not fetching)
Note over Sidebar: skeleton dismissed ✓
useTasks->>TanStackQuery: queryFn = fetchTasks (workspaceId present)
TanStackQuery->>API: GET /tasks?workspaceId=...
API-->>TanStackQuery: TaskMetadata[]
TanStackQuery-->>Sidebar: isLoading=false, data=TaskMetadata[]
Note over Sidebar: tasks rendered ✓
Reviews (2): Last reviewed commit: "fix(tasks): show home UI for empty new t..." | Re-trigger Greptile |
waleedlatif1
commented
Apr 30, 2026
waleedlatif1
commented
Apr 30, 2026
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ef80370. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Summary
tasksLoadingwas derived fromfetchedTasks === undefined, which staystrueforever on query errors or whenworkspaceIdis temporarily absentuseTasksto useskipToken+placeholderData: keepPreviousData— matches the establisheduseWorkflows/useWorkflowMappatterntasksLoadingfromisLoading(isPending && isFetching) instead of data presence — onlytrueduring an active first fetch with no cached dataloggerso silent failures surface in logsType of Change
Testing
Tested manually
Checklist