Skip to content

Prevent duplicate downloads on export/download buttons#1659

Open
heyiamwahab236 wants to merge 2 commits into
DependencyTrack:4.14.xfrom
tecan:fix/vex-export-double-click
Open

Prevent duplicate downloads on export/download buttons#1659
heyiamwahab236 wants to merge 2 commits into
DependencyTrack:4.14.xfrom
tecan:fix/vex-export-double-click

Conversation

@heyiamwahab236

Copy link
Copy Markdown

Description

Export/download buttons started a new download on every click with no
in-progress guard, so clicking (or double-clicking) while a download was
already running triggered multiple simultaneous requests and duplicate file
downloads. This affected the project Findings view (Export VEX, Export VDR)
and the project Components view (Download BOM — inventory / with-vulnerabilities,
and Download component — CSV).

Each handler now sets an in-progress flag with a guarded early return, disables
the corresponding button/dropdown and shows a spinner while the export runs, and
resets the flag in a finally() block so the control re-enables whether the
download succeeds or fails.

Addressed Issue

fixes #1658

Additional Details

The frontend project has no component unit-test harness, so this was verified
manually: with the Network tab open (throttled to Slow 3G to widen the window),
rapid/double clicks on each export control now send only one request and produce
a single download, and the control re-enables after completion or error. Verified
on the Findings (VEX/VDR) and Components (BOM/CSV) views.

Checklist

The 'Export VEX' and 'Export VDR' buttons had no guard against repeated
clicks. Each click started a new blob download, so clicking while a
download was already in progress triggered multiple simultaneous
requests and duplicate file downloads.

Each handler now sets an in-progress flag (guarded early-return),
the corresponding button is disabled and shows a spinner while the
export runs, and the flag is reset in a finally() block so the button
re-enables whether the download succeeds or fails.

Signed-off-by: Abdul Wahab Shah <abdul.shah@tecan.com>
The 'Download BOM' (inventory / with-vulnerabilities) and 'Download
component' (CSV) dropdowns on the project Components view had no guard
against repeated clicks, so each click started a new download and
clicking while one was in progress produced duplicate downloads.

Each handler now sets an in-progress flag (guarded early-return), the
corresponding dropdown is disabled and shows a spinner while the export
runs, and the flag is reset in finally() so it re-enables whether the
download succeeds or fails.

Signed-off-by: Abdul Wahab Shah <abdul.shah@tecan.com>
@owasp-dt-bot

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@heyiamwahab236

Copy link
Copy Markdown
Author

@setchy Can you please have a look at this please.

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