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

Treat all sync-related actions as part of sync #468

Open
sssoleileraaa opened this issue Jul 9, 2019 · 3 comments
Open

Treat all sync-related actions as part of sync #468

sssoleileraaa opened this issue Jul 9, 2019 · 3 comments

Comments

@sssoleileraaa
Copy link
Contributor

sssoleileraaa commented Jul 9, 2019

Description

We want to wait before telling the user that a sync is finished until after everything in a sync batch has been downloaded and decrypted.

This means we need a way to indicate the end of a batch.

First idea: Create a SyncFinishedJob (or maybe call it BatchJob) that we add to the end of our queue after enqueing all new messages and replies. This job will give us a simple way to send the synced signal if it returns successfully, which it will always do if it's processed.

Second idea: We could create a parameter for DownloadJob that indicates whether or not the job is the last job to be processed in the sync. We could call it last_sync_job or something like that. When the job finishes, it can send this in its result.

Current sync behavior

Steps

  1. Update refresh icon in the GUI to show sync is active (either on click or on the 5-minute auto-sync mark)
  2. Fetch all sources, messages, replies, and files from the server
  3. Update local storage
  4. Import keys for all sources into keyring
  5. Update and show all sources in the GUI's source list and show new files available for download and new messages with the string <Message not yet available> in the GUI's conversation view. Once a single message or reply is finished being downloaded asynchronously, the GUI will replace the string to the decrypted text. This happens "on the fly" meaning we don't wait until all the new messages and replies are finished being processed before displaying them in the GUI.
  6. Enqueue download jobs for new messages
  7. Enqueue download jobs for new replies
  8. Update refresh icon so it's no longer active and timestamp in the GUI to show sync completed

Desired sync behavior

Steps

1-7. [Remain the same]
8. Update GUI once all jobs in a sync batch have finished processing in the queue

More notes

Related issues

This was referenced Jul 9, 2019
@ninavizz
Copy link
Member

A sync is a sync is a sync is a sync.

(sorry, I couldn't resist. Also just wanted to get a comment on this to get it on my radar).

@eloquence eloquence changed the title What is a Sync? Treat all sync-related actions as part of sync Jul 10, 2019
@sssoleileraaa
Copy link
Contributor Author

When we're ready to work on this, we should also not show the active sync animation when there aren't any new sources or submissions.

@eloquence
Copy link
Member

Leaving open for discussion, but we don't have user evidence that users are confused or frustrated by current behavior, so moving off backlog for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants