diff --git a/securedrop_client/logic.py b/securedrop_client/logic.py index cfa12dd2f3..35891dbddc 100644 --- a/securedrop_client/logic.py +++ b/securedrop_client/logic.py @@ -347,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() def login_offline_mode(self): """ @@ -493,6 +494,7 @@ def logout(self): self.on_logout_failure) self.api = None self.api_job_queue.logout() + self.api_sync.stop() storage.mark_all_pending_drafts_as_failed(self.session) self.gui.logout() self.is_authenticated = False diff --git a/securedrop_client/sync.py b/securedrop_client/sync.py index d722575947..5a8f817564 100644 --- a/securedrop_client/sync.py +++ b/securedrop_client/sync.py @@ -36,7 +36,7 @@ def __init__( def start(self, api_client: API) -> None: ''' - Stop metadata syncs. + Start metadata syncs. ''' self.api_client = api_client @@ -54,7 +54,7 @@ def stop(self): logger.debug('Stopping sync thread') self.sync_thread.quit() - def sync(self): + def _sync(self): ''' Create and run a new MetadataSyncJob. '''