Repository navigation
fix: show insights after long-running generation - #1346
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
lfnovo
left a comment
There was a problem hiding this comment.
Verified: polling now runs until a terminal status, is cancelled on unmount or replacement via AbortSignal, stops after three consecutive status errors, refetches the source on completion and surfaces failures in a toast. waitForCommand has a single caller, so the return-type change is contained. Thanks @justadityaraj — this unblocks long local-model insights (#1264).
Context
Insight generation can legitimately take longer than four minutes with local models and large sources. The source detail UI stopped checking the command after 120 attempts, so a completed insight remained hidden until the user navigated away and returned.
Fixes #1264
Changes
AbortSignalthrough status requests, cancel on unmount or replacement, and re-check cancellation after the terminal refetch.User impact
Long-running insights now appear in the open Insights tab as soon as generation completes. Leaving the source stops its browser-side polling, and failed jobs no longer end silently.
Verification
npm test— 27 test files passed, 164 tests passed.npm run lint— 0 errors; 7 existing warnings in unchanged files.npm run build— production build, TypeScript check, and static page generation passed.Type of Change
How Has This Been Tested?
Design Alignment
The existing polling path remains in place; this removes its arbitrary duration limit and gives it lifecycle cancellation.
Checklist
Code Quality
Testing
Documentation, Database, and Breaking Changes
Screenshots
Pre-Submission Verification
readyissue [Bug]: Insights tab stops polling after 4 minutes and never shows the finished insight #1264