Skip to content

fix(web): cancel Loom downloads when leaving the downloader - #3453

Open
vedanth-jadhav wants to merge 3 commits into
CapSoftware:mainfrom
vedanth-jadhav:fix/web-loom-downloader-unmount
Open

vedanth-jadhav wants to merge 3 commits into
CapSoftware:mainfrom
vedanth-jadhav:fix/web-loom-downloader-unmount

Conversation

@vedanth-jadhav

@vedanth-jadhav vedanth-jadhav commented Oct 27, 2026 •

Copy link
Copy Markdown

Leaving the free Loom downloader page keeps its conversion running. A late URL lookup can even start a conversion or click a direct-download link after unmount; a late conversion result creates a Blob URL that the already-finished cleanup cannot revoke.

Own one AbortController for the whole download attempt, abort it on unmount, and ignore progress/results/errors after cancellation. The resolver currently has no cancellation API, so its pending lookup can finish, but its result no longer starts work after the page is gone. Pass the controller through conversion and clear the active attempt only from its own finally. Converter setup checks cancellation after asynchronous codec checks, file-picker creation, and conversion initialization; cancellation aborts an opened writable before encoding begins. Completed MP4 URLs remain available while mounted and are revoked on unmount.

Validation: 19 focused tests pass, including seven mounted lifecycle/control cases and three converter setup cancellation cases that fail on the previous head. Four regressions fail against main 8dd141d: missing conversion abort, late converted Blob download, late direct URL download, and late lookup starting conversion. Success URL lifetime, direct download and retry after an error remain covered. Tests use real React unmount and AbortController, with controlled resolver/converter promises; no live Loom network or native conversion claim for these lifecycle tests.

Scoped strict TypeScript/noUncheckedIndexedAccess for the component and new tests, Biome, CI YAML parsing and git diff --check pass. Combined locally with #3448 and #3449, all 34 codec/assembly/lifecycle/conversion/download tests pass. Full web build/typecheck not run. No dependencies or public API changes.

This fixes the downloader component's lifetime; #3448 changes codec requirements and #3449 changes DASH input assembly. The PR is independent and targets main.

RetriggerView in GreptileConfidence Score: 5/5

The cancellation follow-up appears safe to merge.

Summary

The follow-up closes the cancellation gap during Loom conversion setup.

  • The Loom downloader stops an attempt when its page unmounts.

Reviews (2) · Last reviewed commit: "test(loom): preserve cancellation across..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread apps/web/components/tools/LoomDownloader.tsx

Copy link
Copy Markdown
Author

@greptile please review the cancellation follow-up in 042106c.

This branch has not been deployed

No deployments
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.

1 participant