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

add a DownloadJob class #409

Closed
wants to merge 1 commit into from
Closed

Conversation

sssoleileraaa
Copy link
Contributor

@sssoleileraaa sssoleileraaa commented Jun 10, 2019

Description

Resolves #406

Behavior should remain the same. This adds a lot of new tests and an API download base class.

Test Plan

  1. Send a message
  2. Refresh
  3. Send a file
  4. Refresh

except CryptoError as e:
set_object_decryption_status_with_content(db_object, session, False)
logger.debug('Failed to decrypt {}: {}'.format(db_object.filename, e))
raise e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then this exception gets handled in ApiJob._do_call_api

# are on Qubes, we should move the file to the data directory and name it the same as the
# server (e.g. spotless-tater-msg.gpg).
filepath_in_datadir = os.path.join(self.data_dir, server_filename)
shutil.move(file_path, filepath_in_datadir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this being done now? (the file download logic won't work on Qubes otherwise) also let's preserve the above comment since otherwise it's not obvious why this file moving is being done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! Don't know how I missed that comment! Yes, will add back and test on qubes.

@sssoleileraaa
Copy link
Contributor Author

closing because this was broken down into several PRs:

@eloquence eloquence removed this from In Development in SecureDrop Team Board Jun 18, 2019
@sssoleileraaa sssoleileraaa deleted the issue-406-download-job branch July 5, 2019 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: MessageDownloadJob and FileDownloadJob should inherit from new class DownloadJob
2 participants