Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking the download button twice crashes the server #55

Closed
jonodrew opened this issue Feb 9, 2022 · 7 comments
Closed

Clicking the download button twice crashes the server #55

jonodrew opened this issue Feb 9, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@jonodrew
Copy link
Owner

jonodrew commented Feb 9, 2022

Because the server deletes the files once they've been served, users can cause an error if they click the download button again.

Options:

  • ignore multiple clicks
  • only allow one click and then close the dialog, or deactivate the button

@johnpeart which do you think is better for users?

@jonodrew jonodrew added the bug Something isn't working label Feb 9, 2022
@johnpeart
Copy link
Collaborator

I think it would be better to deactivate the button.
We could can add a disabled class to the button and change the text on the button to 'Download completed'?

@jonodrew
Copy link
Owner Author

That sounds good! I'll pop this in the baclog then and we can get to it when we get to it. Let's do it after finishing #57 so it's in the right place (or alternatively, we can move the dialog to its own file and then pull it in where we need it)

@johnpeart
Copy link
Collaborator

@jonodrew Having reflected on this further, should we:

  1. Remove the dialog entirely – it doesn't work in all browsers anyway – then
  2. Add a separate 'download' page, and
  3. Once the button is clicked, redirect the user to a 'finished' page

@jonodrew
Copy link
Owner Author

I like these ideas. The redirect would need to be via javascript, because that's what's polling the task at the backend. I might need your help with that. Then we can have a download page with a bit of info that says how long the data will be kept if it's now downloaded, and then as you say the finished page.

To note that while the data is available, anyone going to that link could download the data. However, given that it's described by a long random string, I think we can be confident that it's not guessable

Resolving this will impact #64 I think

@johnpeart
Copy link
Collaborator

@jonodrew I've created a draft pull request that makes a start on this; grateful for your additional input as I've taken it about as far as I can fathom on my own!

@johnpeart
Copy link
Collaborator

I think the changes made in #65 resolve this problem by default?

@jonodrew
Copy link
Owner Author

Closed by #65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants