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

Create a MetadataSyncJob #461

Closed
sssoleileraaa opened this issue Jul 5, 2019 · 6 comments · Fixed by #640
Closed

Create a MetadataSyncJob #461

sssoleileraaa opened this issue Jul 5, 2019 · 6 comments · Fixed by #640
Assignees
Milestone

Comments

@sssoleileraaa
Copy link
Contributor

Description

Move api calls to sync the client with the server into and ApiJob and ensure that it is called precisely every five minutes or immediately when the user clicks refresh.

Background

The client syncs with the server every five minutes by calling sync_api, which makes the following api calls:

  • get_sources
  • get_submissions (for each source)
  • get_all_replies

Whenever sync_api returns successfully, the client then downloads and decrypts any new message or reply.

@sssoleileraaa
Copy link
Contributor Author

Note: There could be jobs in the queue for downloading and decrypting that are not finished when the next sync happens on the 5-minute mark or when the user clicks the refresh button. This is okay because jobs will only be added for new submissions or replies.

@sssoleileraaa sssoleileraaa changed the title Create a SyncJob Create a MetadataSyncJob Jul 9, 2019
@sssoleileraaa
Copy link
Contributor Author

The following issue will be affected or resolved when metadata sync is moved to the queue: #462

@sssoleileraaa
Copy link
Contributor Author

Right now a user can click the refresh link when the queue is paused (while the "retry" error message is showing). Once refresh/metadata sync is moved to the queue, a pause should either disable the refresh icon or resume the queue.

@eloquence eloquence added this to the 0.2.0beta milestone Oct 8, 2019
@eloquence eloquence modified the milestones: 0.2.0beta, 0.2.0alpha Oct 23, 2019
@eloquence
Copy link
Member

Per #489 (comment) this also will help us resolve other issues, so we've agreed to prioritize it in the 10/23-11/6 sprint period, and I've added it to the alpha milestone.

@kushaldas
Copy link
Contributor

I will pick up this one.

@redshiftzero
Copy link
Contributor

There could be jobs in the queue for downloading and decrypting that are not finished when the next sync happens on the 5-minute mark or when the user clicks the refresh button. This is okay because jobs will only be added for new submissions or replies.

since for a given document A its is_downloaded field is only going to be updated once its download job is completed, if the download job is in the queued state when the second sync occurs, the second sync will add another job for document A. For now this is OK but I think we need to add a mechanism to deduplicate queue jobs in the future - this would also handle the situation in #116 (to be fair that could be avoided with a pending status in the FileWidget to prevent the user from triggering the download again).

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 a pull request may close this issue.

4 participants