Skip to content

fix(web): clear stale converter selection on invalid input - #3054

Open
yashranaway wants to merge 3 commits into
CapSoftware:mainfrom
yashranaway:fix/browser-media-converters
Open

yashranaway wants to merge 3 commits into
CapSoftware:mainfrom
yashranaway:fix/browser-media-converters

Conversation

@yashranaway

@yashranaway yashranaway commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

in the format converter tools, if you picked a valid video and then picked a wrong type or a file over 500mb, it showed the error but kept the first video selected with convert still enabled. so you could end up converting a file you thought you'd replaced.

picking a new file now clears the old selection first, along with the previous output and its blob url, and only sets the new one if it passes the checks. test picks a valid file then an invalid and an oversized one and checks nothing stays selected. also added it to the web test list in ci.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no blocking issues remain.

Summary

Clears the old file and converted output before checking a replacement.

  • The converter clears old selections when a replacement fails its checks.

No new actionable issues found. Tests were inspected but not run.

Reviews (2) · Last reviewed commit: "fix(web): keep converter selection durin..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

@yashranaway 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/MediaFormatConverter.tsx
@richiemcilroy

Copy link
Copy Markdown
Member

Thanks for this. One problem it introduces:

  1. The file input and drop zone stay active while a conversion is running. If you pick an invalid or oversized file mid-conversion, this now clears file, but the running conversion still sets outputUrl when it finishes. The page then shows "Conversion complete!" with a Download button that does nothing, because handleDownload returns early when file is null. Please either ignore new selections while isConverting (disable the input and drop handler), or make each conversion check it is still the current one before it sets outputUrl. Please add a test that replaces the file during a conversion.

Once that's in, we'll re-run the Greptile review. It needs a 5/5 plus green CI to merge.

@yashranaway

Copy link
Copy Markdown
Contributor Author

@greptileai review

@yashranaway

Copy link
Copy Markdown
Contributor Author

@richiemcilroy done in ebc9cde. new selections are ignored while a conversion runs and the file input is disabled during it. the new test drops an invalid file mid-conversion and checks the original file and a working download are still there when it finishes. greptile is 5/5.

…onverters

# Conflicts:
#	.github/workflows/ci.yml

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.

2 participants