`Handle Download` Block - file path is not assigned to the variable
Describe the bug
After using the Handle download block, when the file is already downloaded and the next block is started, the file path of the downloaded file is not assigned to the set variable.
To Reproduce Steps to reproduce the behavior:
- Use the
Handle downloadblock. - Check the
Wait for the file to be downloadedsetting and enter the variable name inAssign to variable. - Run the workflow and download the file from any site
- Go into the workflow logs and see if the variable has assigned itself
Expected behavior
After using the Handle download block, the `{{variables.path}} variable should contain the path to the downloaded file.
Screenshots
Desktop (please complete the following information):
- OS:
MacOS - Browser:
Brave Browser - Extension Version:
1.28.27
Additional context Add any other context about the problem here.
The processing download module may not get the file path immediately, you can add a delay
I added a delay and tested:
- the file is downloaded in 2 seconds
- module after 20 seconds does not return the path
- module changes the previously set variable and leaves it empty
Delay use before processing downloads
Still the module does not get the file path
Hello, I don't want this issue to die. The problem is still not fixed and the feature is not working. Can you find someone willing to fix it?
Hello, I don't want this issue to die. The problem is still not fixed and the feature is not working. Can you find someone willing to fix it?
@xartuu
Thank you for your message. I'm sorry for the delay in getting to it. I'll try to reproduce and fix the issue. It seems like a bug. If you can provide a minified, reproducible workflow (exported as a JSON file) with desensitized data, it would be very helpful.
I don't know how to reproduce my situation, as it occurs on a business portal with limited access. Overall, I click on a button that is supposed to generate a report with data (in .xlsx Excel). From what I can tell, JS processes the data, as the site does not send any request, and then a window pops up to save the file.
Along with my comment, I poked around a bit in the Automa code and came to a way that restores the operation in my case. I would describe it as “processing nearest/future download”. In short if the downloadId is not specified it listens for the download and if there is no filename when the download is finished it checks it in the Chrome API.
https://github.com/xartuu/automa/commit/0ce148ba3dd4ecad5a27bb3b884cacbaefd60049
@bingren-yd did you take a look at it^?
@bingren-yd did you take a look at it^?
Yes, I apologize for the slight delay. I've reviewed the code you provided, and it looks correct.
There's just one more step that would be helpful. If you could create a PR request in the Automa project following the GitHub flow (and then I'll merge it into the main branch), it would be much appreciated. This way, you'll be automatically credited in the next changelog and release, as you were the one who discovered and resolved the issue.
@xartuu