-
Notifications
You must be signed in to change notification settings - Fork 42
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
Make sync continuous #739
Make sync continuous #739
Conversation
This cannot be merged until #732 is merged, which removes user-initiated syncs via the Refresh button in the upper left-hand corner of the client. |
0a8be5e
to
9afaed8
Compare
9e7d342
to
3e1c31f
Compare
@@ -334,7 +337,7 @@ def on_authenticate_success(self, result): | |||
self.gui.show_main_window(user) | |||
self.update_sources() | |||
self.api_job_queue.login(self.api) | |||
self.sync_api() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is where we used to call sync_api on login which i replaced with starting the background sync thread
@@ -344,6 +347,7 @@ def on_authenticate_failure(self, result: Exception) -> None: | |||
error = _('There was a problem signing in. ' | |||
'Please verify your credentials and try again.') | |||
self.gui.show_login_error(error=error) | |||
self.api_sync.stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we log out we need to make sure the background sync thread does not continue making api requests to get new data from the server
I left some inline comments to help with review. |
5323149
to
8021f5b
Compare
This is ready for review. The last PR dependency this relies on is this one: #737 (removal of sync_api from the gui and controller when file is missing). For now you can cherry-pick the 2 commits from that PR to here to see tests pass and review the code. |
560a53d
to
11c09c6
Compare
This is no longer blocked |
7b827c8
to
d2c49eb
Compare
rebased on |
I started looking at this today - this is looking pretty good to me but I'll finish review tomorrow AM and drop any comments in the PR for when you sign on @creviera |
review comments addressed |
eaa3a54
to
20050ba
Compare
20050ba
to
417473b
Compare
rebased on |
excellent, my comments above were addressed, thanks! so there's an unexpected behavior that I observed when I was running this in Qubes: when I paused my app-staging VM in order to test the pause behavior, I got the login screen and a "session expired, login again" [paraphrasing] message - have you seen this too? My expectation was that I'd see a pause and the retry banner... I'm not sure if it's related to this change yet |
I have not seen this but I'll work on repro'ing. This would mean that the MetadataSyncJob is seeing an ApiInaccessibleError when this occurs, so I'll pay close attention to the logs, and will also check Update: We are correctly interpreting AuthError to mean the token is invalid/expired but the SDK is incorrectly sending request timeout and other types of errors as AuthErrors. See comment below for explanation. |
It looks like this is occurring because of this issue I just opened up in the SDK repo: freedomofpress/securedrop-sdk#109 The reason this has gone unnoticed on Once the client begins receiving |
While running the branch, I am getting the following error in the log:
|
ah looks like a pinged signal was missed in the removal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all my comments were addressed, and kushal's comment was addressed in the latest change so I'm gonna approve this 🚢
there is still the outstanding issue discovered during review here, but that will be resolved separately as part of freedomofpress/securedrop-sdk#109 |
Description
Followup from #652
Fixes #672
Fixes #671
This is the last PR for the sync architecture change to have a continuous metadata syncs that occur frequently and unpause the queue when they succeed
This is dependent on the following PRs getting merged first (for now I cherry-picked them here so others working on the client will have visibility):
This PR includes the following changes:
Test Plan