Let a running save or upload be stopped - #56
Merged
Conversation
A delivery of a long snippet is minutes of work — decode, encode, hash, then transfer — and how long it will take is not apparent before it starts: a selection dragged a few seconds too far on the overview reads exactly like any other. Until now the only way out of one was to reload the page, which loses the video, the marks and the description with it. A Stop button now stands beside Save/Upload while a delivery runs. It trips an AbortSignal (lib/interrupt.ts) that every step of the assembly takes and that the steps between them read: extraction (mediabunny's conversion is cancelled where it stands; an ffmpeg.wasm run tears the worker down, since @ffmpeg/ffmpeg's own signal only rejects the promise and leaves the encode running inside it), the three hashing passes at every 16MB chunk boundary, the overlay's per-frame loop, each S3 part transfer, and every file handover. A stop is reported as its own outcome rather than as a failure: the save route says nothing was written, and the upload route says how many files had already gone up and stay in the dataset. Either way the card comes back — Upload on offer again, the video and pose swappable — so the selection can be adjusted and sent a second time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pt65qnMfSgyANAk2huR647
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pt65qnMfSgyANAk2huR647
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 84.03% 84.32% +0.29%
==========================================
Files 40 41 +1
Lines 1810 1850 +40
Branches 453 460 +7
==========================================
+ Hits 1521 1560 +39
- Misses 289 290 +1
🚀 New features to boost your workflow:
|
CodyCBakerPhD
marked this pull request as ready for review
August 29, 2026 20:57
The toggle's first side and its button now read "Export", and the copy
around them follows: the card's hint, the caption asking for a
description, and the outcome lines ("Exported <bundle>", and a stopped
run now reading "Export stopped. Adjust the selection and try again."
rather than spelling out that nothing was written).
The persisted setting keeps its "download"/"upload" values, and the
element ids are unchanged, so a stored choice still resolves and nothing
outside the visible copy moves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pt65qnMfSgyANAk2huR647
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.
A Stop button now stands beside Save/Upload while a delivery runs, so an accidentally long snippet can be called back instead of waiting it out or reloading the page (which loses the video, the marks and the description with it).
What it stops
Stop trips an
AbortSignal(newsrc/lib/interrupt.ts) that every step of the assembly takes, and that the steps between them read:@ffmpeg/ffmpeg's ownsignalonly rejects the promise and leaves the encode running inside the worker.ensureFfmpegloads a fresh instance next time (the core is a cached fetch by then).What it reports
A stop is its own outcome, not a failure: a new neutral
stoppedstatus class rather than the rederrone. The save route says nothing was written; the upload route says how many files had already gone up and stay in the dataset (registered assets are not withdrawn). Either way the card comes back — Upload on offer again, the video and pose swappable — ready for an adjusted selection.Tests
tests/unit/interrupt.test.tsfor the primitives, plus interruption cases in the etag, upload and extract suites, andtests/integration/interrupt.spec.ts, which holds an S3 part transfer open, presses Stop, and checks that nothing was registered and the card is usable again.Original prompt
We need the ability to do an interruption to reset and adjust during save or upload operation, in case an accidentally long snippet was selected
Generated by Claude Code