Fix source_app.utils.normalize_timestamps - #5724
Merged
Merged
Conversation
|
This pull request introduces 1 alert when merging 7add4ce into cbcc894 - view on LGTM.com new alerts:
|
rmol
force-pushed
the
fix-normalize-timestamps
branch
from
January 19, 2021 23:29
7add4ce to
220e586
Compare
rmol
force-pushed
the
fix-normalize-timestamps
branch
from
January 20, 2021 15:57
220e586 to
dcb7551
Compare
zenmonkeykstop
approved these changes
Jan 20, 2021
zenmonkeykstop
left a comment
Contributor
There was a problem hiding this comment.
Test plan passes, LGTM once CI is green
Codecov Report
@@ Coverage Diff @@
## develop #5724 +/- ##
========================================
Coverage 85.58% 85.58%
========================================
Files 52 52
Lines 3773 3773
Branches 471 471
========================================
Hits 3229 3229
Misses 439 439
Partials 105 105
Continue to review full report at Codecov.
|
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
Ready for review
Description of Changes
Upon each new submission,
source_app.utils.normalize_timestampis called to update the timestamps of all the source's submissions. It currently uses thetouchcommand to do this, which means if a file has gone missing, it will be recreated empty. This could mask problems that would otherwise be detected by the daily check for disconnected submissions. The function is also omitting the most recent submission from the arguments, assuming thattouchis going to give the previous submissions the same timestamp as the new one, which might not be true if it's not processed instantaneously.This changes the function to call
touchwith the--no-createflag and all of the source's submissions.Testing
make devdocker exec -it securedrop-dev-0 bash/var/lib/securedrop/storeand delete the file of the message you just submitted.2-...and3-...) and that their timestamps match.Deployment
No special considerations.
Checklist
If you made changes to the server application code:
make lint) and tests (make test) pass in the development containerIf you made non-trivial code changes:
Choose one of the following: