Fix file download limiting - #5835
Bubballoo3 wants to merge 7 commits into
Conversation
|
I don't see the error shown in the page when pressing the download button in the dropdown. I see it in the iframe's response, but not on the actual browser's page. |
|
Glancing at the test, the tests do the same thing. You're able to see the error when you click on the download button from the dropdown? |
Yeah every time. Are you able to get the error message from attempting to open the file? Like I mention above, a failed download should redirect to a view attempt, so there is no reason the behavior should differ |
|
I don't get the error in chrome, so that seems to be the source of the discrepancy |
|
Ok I think I got this fixed now, the issue was that Chrome was keeping the iframe around even after the redirect, meaning that the json request from the iframe actually fired after the request to view the file. Since we only flash the alert on the very next request, this json response cleared out the error message before it could be propagated. By removing the iframe immediately after redirecting, this additional request is prevented and the error message displays. |
Fixes #5828 and fixes #4984. Resolves both the redirect loop and error message issues, without meaningfully changing the flow for valid downloads. While the behavior looks fine in manual testing, the test cannot seem to find the error message locally. I'll see if that is improved in the CI, but kind of doubt it. Any advice or help on that issue would be appreciated.
I noted in #5828 that the error message works well for viewing files, just not for downloading them. So what I have done is effectively
I can see in the test logs that the expected redirects are happening, but for some reason there is no alert passed on the final view file response. I am always able to see this error when testing manually.
I hope that other eyes here can pick up on something I missed that is failing the test, otherwise I would be happy to move forward by rigorously testing this manually and opening an issue to complete the test separately. Unfortunately I think this redirect strategy is the only way to produce the behavior that we want without substantially changing how downloads are performed (such as making the request flow more similar to directory downloads, for instance).
Testing
test helpCode Authorship & Understanding
and I take responsibility for its correctness.
Checklist
Anything else?
Screenshots, context, or anything reviewers should know.