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

downloading animation never ends if the file cannot be decrypted #754

Closed
sssoleileraaa opened this issue Jan 31, 2020 · 6 comments · Fixed by #768
Closed

downloading animation never ends if the file cannot be decrypted #754

sssoleileraaa opened this issue Jan 31, 2020 · 6 comments · Fixed by #768
Assignees
Labels
bug Something isn't working

Comments

@sssoleileraaa
Copy link
Contributor

STR

  1. Click on "Download" next to a file that you know will fail to decrypt with gpg --decrypt filepath because of a bad key, missing encrypted file in the expected filepath, etc. For repro purposes I suggest raising CryptoError during the decryption step of a file.

Expected

"Failed to download" message and the "Download" button to replace "Downloading" animation

Actual

"Failed to download" message and the "Downloading" animation continues indefinitely:

Peek 2020-01-31 14-44

@redshiftzero
Copy link
Contributor

@rmol started working on this today

@sssoleileraaa
Copy link
Contributor Author

A recent change that was merged to master made it so that the downloading animation never ends, even if the file is successfully downloaded and decrypted.

@sssoleileraaa
Copy link
Contributor Author

Actually I decided to make a issue, because it looks like the issue started when we mismatched the slot and signal signatures, which the open PR fixes.

@rmol
Copy link
Contributor

rmol commented Feb 5, 2020

The animation problem was because we used to use a timer to start the animation, and if the download process finished before the animation started, regardless of success or failure, the stop request happened early so the animation kept going.

This was fixed in #768.

@sssoleileraaa
Copy link
Contributor Author

this was reintroduced at some point

@sssoleileraaa sssoleileraaa reopened this Mar 5, 2020
@sssoleileraaa
Copy link
Contributor Author

nvm i saw this when raising crypto error during the download step, which should never happen. i see this fixed with the following diff:

--- a/securedrop_client/api_jobs/downloads.py
+++ b/securedrop_client/api_jobs/downloads.py
@@ -172,6 +172,7 @@ class DownloadJob(ApiJob):
         Decrypt the file located at the given filepath and mark it as decrypted.
         '''
         try:
+            raise CryptoError('test')
             original_filename = self.call_decrypt(filepath, session)
             mark_as_decrypted(
                 type(db_object), db_object.uuid, session, original_filename=original_filename
(END)

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

Successfully merging a pull request may close this issue.

3 participants