Fix #5555: downloads not working from Bitstreams tab and Workspace/Wo…#5557
Fix #5555: downloads not working from Bitstreams tab and Workspace/Wo…#5557guillermo-escire wants to merge 2 commits intoDSpace:mainfrom
Conversation
|
Hello! Started to test this, but found that I couldn't replicate the original bug locally yet in order to test the fix. Currently I have similar local configuration to what was on Sandbox during testathon. @guillermo-escire Was there any particular config that you needed in order to see the download silent-hanging behavior locally? |
|
Hi @lgeggleston! The bug can be replicated by making sure the bitstreamDownloadRedirectGuard is active, which was introduced in #5132. To reproduce it on the Bitstreams tab, you just need to be logged in as Admin, go to any Item -> Administer -> Bitstreams tab, and click the download button. The key is that before this fix, the button used [href] instead of [routerLink], so the guard was never triggered and the download would hang. You may need to check that your local build includes the changes from #5132. For the Workspace/Workflow case, go to MyDSpace, open any submission with an uploaded file, and click the download button next to the file. |
tdonohue
left a comment
There was a problem hiding this comment.
@guillermo-escire : Thanks for this PR. I've tested it today and found it only fixes one of the bugs.
It fixes the bug where you couldn't download bitstreams from the "Administer -> Bitstreams" tab. However, it does not fix the bug where you cannot download bitstreams from in progress submissions (in workspace/workflow).
Here's how to reproduce the bug I'm still seeing:
- First, I'm testing in production mode (
npm run build:prod && npm run serve:ssr) - Login as an Admin or user with submit privileges
- Start a new submission
- Immediately upload a file to that submission.
- Now, click the download button next to the newly uploaded file. The download will attempt to open in a new tab but will fail. The download still appears to hang.
So, I think your changes to the item-edit-bitstaream-bundle.component.html are correct, but your changes to the section-upload-file.component.ts don't appear to fix the issues when downloading from a WorkspaceItem.
|
Hit @tdonohue , thank you for the detailed testing steps! I will investigate the Workspace/Workflow download issue further and push a fix soon. |
|
Hi @tdonohue, thanks for the detailed feedback! I was able to reproduce the issue in production mode following your exact steps. The new fix replaces ds-file-download-link in section-upload-file.component.ts with a direct download button that uses FileService.retrieveFileDownloadLink() to obtain a short-lived token and opens the download link directly in a new tab, bypassing the guard entirely for this context. I've tested it in both dev and production mode and it works correctly now. Please let me know if you need any additional changes! |
References
Fixes #5555
Description
Downloads were silently hanging from the Administer → Bitstreams tab and the Workspace/Workflow area due to two issues introduced by #5132, which added the bitstreamDownloadRedirectGuard.
Instructions for Reviewers
List of changes in this PR:
How to test:
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.