Fix source_app.utils.normalize_timestamps #5724
Merged
+73
−6
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_timestamp
is called to update the timestamps of all the source's submissions. It currently uses thetouch
command 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 thattouch
is 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
touch
with the--no-create
flag and all of the source's submissions.Testing
make dev
docker exec -it securedrop-dev-0 bash
/var/lib/securedrop/store
and 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: