Skip to content

Conversation

@pawelangelow
Copy link
Contributor

@pawelangelow pawelangelow commented Dec 2, 2025

What

Everything worked until it was bundled in Electron.


Note

Enable bulk action report download in Electron by exposing Content-Disposition header server-side and fetching with window ID client-side to derive filename and trigger blob download.

  • Backend (API):
    • Update BulkActionsService.streamReport to set Access-Control-Expose-Headers: Content-Disposition for downloadable reports in redisinsight/api/src/modules/bulk-actions/bulk-actions.service.ts.
  • Frontend (UI):
    • Rewrite triggerDownloadFromUrl in redisinsight/ui/src/utils/dom/triggerDownloadFromUrl.ts to use fetch with CustomHeaders.WindowId when available, parse Content-Disposition for filename, and download via blob URL.
  • Tests:
    • Extend bulk-actions.service.spec.ts to assert the new Access-Control-Expose-Headers header.

Written by Cursor Bugbot for commit da92494. This will update automatically on new commits. Configure here.

@pawelangelow pawelangelow self-assigned this Dec 2, 2025
@pawelangelow pawelangelow changed the base branch from main to release/3.0.0 December 2, 2025 12:23
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.84% 21020/25373
🟡 Branches 68.01% 8846/13007
🟡 Functions 78.03% 5756/7377
🟢 Lines 83.25% 20586/24728

Test suite run success

5468 tests passing in 703 suites.

Report generated by 🧪jest coverage report action from da92494

document.body.removeChild(link)

// Clean up the blob URL
URL.revokeObjectURL(blobUrl)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Blob URL revoked immediately may fail download

The URL.revokeObjectURL(blobUrl) is called synchronously right after link.click(). However, click() only initiates the download and returns immediately - it doesn't wait for the download to complete or even start. In some browsers or environments (including Electron, which this PR specifically targets), the blob URL may be revoked before the browser has finished reading the blob data, causing the download to fail silently. A common solution is to delay the revocation using setTimeout or defer it until after a brief period.

Fix in Cursor Fix in Web

@pawelangelow pawelangelow merged commit 55be58a into release/3.0.0 Dec 2, 2025
34 checks passed
@pawelangelow pawelangelow deleted the bugfix/fix-download-report-for-electron branch December 2, 2025 12:30
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