-
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
Fix starring behavior #952
Conversation
027edb3
to
8df12d5
Compare
I added
|
So I was able to fix # 3 and # 4 Issue 1 in the last commit. You should see the star go back to the current source.is_starred state after a non-timeout error at the same time you see the "Failed to update star" message in the error bar. |
b4bf102
to
a1d3036
Compare
oops, so first i didn't push the commit, and now it has new conflicts with the latest changes on master... i'll fix now... |
a1d3036
to
a9b61b5
Compare
the conflict was in
--- a/securedrop_client/api_jobs/updatestar.py
+++ b/securedrop_client/api_jobs/updatestar.py
@@ -22,6 +22,9 @@ class UpdateStarJob(ApiJob):
Star or Unstar an user on the server
'''
try:
+ import time
+ time.sleep(3)
+ raise Exception('errrrororror')
source_sdk_object = sdclientapi.Source(uuid=self.source_uuid)
# TODO: Once https://github.com/freedomofpress/securedrop-client/issues/648, we will
|
I switched to your method of breaking the star update job, but I'm still not seeing the stars reset to the state before they were toggled. |
i just tested in qubes and am seeing this issue resolved so one of us is probably forgetting to do something - probably me. but it's late on friday so maybe we could both retest on monday and figure out why we see different things? |
It's the sleep you have in your test breakage. If I add that, the star does get reset. Without it, it does not; it's left starred. |
This looks good now; scheduling the update works for exceptions in client or server, starring or unstarring. If you're happy, I think it's ready to merge. |
5847415
to
e26c538
Compare
(rebased) |
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
WIP until I update unit tests and write a test plan.
Fixes #946
Resolves #760
Closes #811
Fixes #954
This fixes the crash reported in #946, resolves #760 and part of #954 by no longer updating sources whenever a source is starred, closes #811 by retrying star jobs that fail due to timeout, and fixes the rest of #954 so that stars are updated immediately and only toggle back at the same time an error is displayed that says "Failed to update star" or when a star is updated on the server. This also removed the extra callback that toggled stars unpredictably given that there were two callbacks.
Test Plan
master
Checklist
If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable: