-
Notifications
You must be signed in to change notification settings - Fork 39
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
update gui instead of sync when file missing #724
Conversation
securedrop_client/logic.py
Outdated
logger.debug('Cannot find {} in the data directory. File does not exist.'.format( | ||
file.original_filename)) | ||
storage.update_missing_files(self.data_dir, self.session) | ||
self.session.refresh(file) |
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.
I don't think this updates the UI until the conversation view is redrawn for other reasons, i.e. if we click off this source and back onto the source corresponding to the missing file or if a sync happens to finish (btw to quickly see what parts of the UI are updating naturally even without network I've been commenting out this adding of the metadata sync job).
I think we want to make sure that the state of the UI is representing the state of the locally stored data even without frequent network syncs, since it's expected that even in the best conditions there will be multi-second delay, let me know what you think
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.
so i removed the refresh line since it is unnecessary.
also, just an explanation of what i'm trying to do in this pr: instead of relying on sync_api, we now call update_missing_files directly when we learn that the file does not exist. this made it so we could remove 3 unnecessary sync_api calls and you can see that it still works:
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.
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.
ah, there was a call to sync_api from the GUI... that explains why this was working. since we don't want calls to sync_api, i updated the GUI to receive a file_missing signal from the Controller instead
looks like this needs a rebase now that we have the ci fix from earlier this week |
fa7e4e0
to
71d7cf3
Compare
71d7cf3
to
3bc7042
Compare
@rmol thanks for the offline feedback, this is ready for review |
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.
looks great! my comments are addressed
@rmol gonna let you check this one out too
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.
👍
Description
Closes #670
Test Plan
Repeat steps 1-3 for export and print
Known issue
Currently refreshing the file object in the session clears the error status message so I removed the error message for now, see: #723