FIREFLY-2064: Failed to save large downloads - #2023
Merged
Merged
Conversation
- switch response.blob() to iframe form post - fix suggested name to support additional standards
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Moderate filename parsing and download error-handling issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 3
Open (3)
What changed in this PR
This PR changes large-file downloads to stream through iframe/form submissions and improves filename handling and download status tracking.
Changes:
- Adds cookie-based download-start detection.
- Updates table and job-monitor download flows.
- Adds RFC-style
Content-Dispositionhandling.
Review findings:
URLDownload.java: escaped quotes in filenames are not parsed correctly.fetch.jsandJobMonitor.jsx: websocket setup failures can leave jobs stuck inWORKINGwith unhandled rejections.
| File | Summary |
|---|---|
src/firefly/test/edu/caltech/ipac/util/download/URLDownloadTest.java |
Tests filename header behavior. |
src/firefly/js/util/fetch.js |
Implements iframe downloads and cookie polling. |
src/firefly/js/tables/ui/TableSave.jsx |
Tracks table download preparation and completion. |
src/firefly/js/core/background/JobMonitor.jsx |
Updates download status handling. |
src/firefly/java/edu/caltech/ipac/util/download/URLDownload.java |
Adds filename parsing and header generation. |
src/firefly/java/edu/caltech/ipac/firefly/server/servlets/HttpServCommands.java |
Adds download headers and startup cookies. |
src/firefly/java/edu/caltech/ipac/firefly/server/servlets/CommandService.java |
Resets download responses on errors. |
src/firefly/java/edu/caltech/ipac/firefly/server/servlets/AnyFileDownload.java |
Adds download cookies and safe headers. |
src/firefly/java/edu/caltech/ipac/firefly/server/RequestAgent.java |
Supports websocket metadata from query parameters. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
robyww
approved these changes
Sep 24, 2026
robyww
left a comment
Contributor
There was a problem hiding this comment.
I found a some little things, that you might want to checkout before you merge. Otherwise it looks good.
| showInfoPopup(truncate(message, {length: 200}), 'Unexpected error'); | ||
| return await Promise.race([ | ||
| waitForCookie(DOWNLOAD_COOKIE_PREFIX + token, () => stopped).then(() => true), | ||
| failed.then(() => false) |
Contributor
There was a problem hiding this comment.
Interesting code. Took some study to understand.
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.

Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-2064
Test: Normal table/image save functions
https://firefly-2064-large-file-download.irsakubedev.ipac.caltech.edu/firefly/
Test: Downloading a large zip file.
https://firefly-2064-large-file-download.irsakubedev.ipac.caltech.edu/applications/Spitzer/SHA/