Let users reprocess runs whose files have stalled - #224
Merged
Conversation
The run reprocess endpoint already queues raw files that are uploaded, failed, completed, or stuck in `processing` past the stall window. The runs table disagreed: `canReprocessRun` counted only the first three, so a run whose only unfinished file had stalled offered no way to retry it from the row menu or the bulk bar. The status tooltip on that same row already said "can be reprocessed", which made the gap look like a bug. Add `reprocessableFileCount` as the single place that sums the buckets the endpoint would queue, and gate the row action on it. The confirmation dialog was re-deriving the same sum from three separate count props, which is how the two sides drifted apart, so it now takes one pre-summed `eligibleFileCount` instead. Dialog copy updated to match what it counts. This also covers the dashboard runs table, which renders the same `RunRowActions`. Co-authored-by: Cursor <cursoragent@cursor.com>
The "Comments (N)" heading was rendered by the server component from the initial fetch, so posting or deleting a comment updated the list but left the count stale until the next refresh. Move the heading into `RunCommentsList` and derive the count from the optimistic array, so it tracks create and delete without a second piece of state. Co-authored-by: Cursor <cursoragent@cursor.com>
The column rendered every pattern inline, so instruments with many patterns stretched the row. Reuse `TruncatedBadges`, which already caps the visible count and puts the rest in a tooltip. `TruncatedBadges` gains `variant` and `badgeClassName` pass-throughs so the instruments table keeps its outline styling. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Runs whose files have stalled now offer Reprocess run in the row menu and the bulk action bar on the instrument runs table.
Changes
A file counts as stalled once it has sat in processing past the stall window (20 minutes by default), meaning the processor went away and it needs another attempt. Reprocessing a single stalled file already worked from the run detail page; the runs table had no equivalent for the whole run.
The server was already correct —
POST /api/v1/instruments/:id/runs/:runId/reprocessqueues every raw file that is uploaded, failed, completed, or stalled. Only the browser-side check disagreed:canReprocessRuncounted the first three and left stalled out, so a run whose only unfinished file had stalled offered no retry, even though its status icon said the file "can be reprocessed".reprocessableFileCountnow sums the four states the endpoint queues, andcanReprocessRunreads it. The confirmation dialog had been re-deriving that sum from three separate count props, which is how the two sides drifted apart; it takes one pre-summedeligibleFileCountinstead, with wording updated to match. The dashboard runs table shares the same row-actions component and picks up the fix too.Driveby changes
Separate commits, droppable.
RunCommentsListand now counts the list the page renders.TruncatedBadges: first two visible, rest in a tooltip.Testing
web/tests/unit/run-row-actions.test.tscovers the stalled case, each eligible state on its own, and the refusals: still inside the stall window, soft-deleted, and an instrument type with no processor.npm run test:unit(369 tests) andmake checkboth pass.By hand: on an instrument page, open the "…" menu of a run with a file stuck past the stall window — Reprocess run is there.