Skip to content

Let a running save or upload be stopped - #56

Merged
CodyCBakerPhD merged 4 commits into
mainfrom
claude/interruption-save-upload-ve7rh7
Aug 29, 2026
Merged

Let a running save or upload be stopped#56
CodyCBakerPhD merged 4 commits into
mainfrom
claude/interruption-save-upload-ve7rh7

Conversation

@CodyCBakerPhD

Copy link
Copy Markdown
Member

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 (new src/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 the worker. ensureFfmpeg loads a fresh instance next time (the core is a cached fetch by then).
  • Hashing — read at every 16MB chunk boundary, which is the longest uninterruptible stretch a delivery has.
  • The pose overlay — read between frames.
  • Uploads — each S3 part transfer, plus a check before registering an asset, so a stop does not leave an asset pointing at a blob it was about to abandon.
  • Every file handover, centrally, so whatever was just extracted or hashed is dropped rather than saved or sent.

What it reports

A stop is its own outcome, not a failure: a new neutral stopped status class rather than the red err one. 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.ts for the primitives, plus interruption cases in the etag, upload and extract suites, and tests/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

claude added 3 commits August 29, 2026 20:54
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
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-29 21:19 UTC

@codecov-commenter

codecov-commenter commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.42254% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/lib/ffmpeg.ts 0.00% 10 Missing ⚠️
src/lib/streaming.ts 0.00% 8 Missing ⚠️
src/lib/extract.ts 75.00% 3 Missing ⚠️

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
src/lib/bundle.ts 93.22% <ø> (ø)
src/lib/datasetDescription.ts 100.00% <ø> (ø)
src/lib/etag.ts 95.18% <100.00%> (+0.30%) ⬆️
src/lib/generatedBy.ts 100.00% <ø> (ø)
src/lib/interrupt.ts 100.00% <100.00%> (ø)
src/lib/s3.ts 100.00% <100.00%> (ø)
src/lib/testInjection.ts 47.15% <ø> (ø)
src/lib/upload.ts 98.59% <100.00%> (+0.08%) ⬆️
src/lib/extract.ts 36.53% <75.00%> (+12.69%) ⬆️
src/lib/streaming.ts 88.43% <0.00%> (-2.38%) ⬇️
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CodyCBakerPhD CodyCBakerPhD self-assigned this Aug 29, 2026
@CodyCBakerPhD
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
@CodyCBakerPhD
CodyCBakerPhD merged commit c5ed5f8 into main Aug 29, 2026
15 checks passed
@CodyCBakerPhD
CodyCBakerPhD deleted the claude/interruption-save-upload-ve7rh7 branch August 29, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants