Skip to content
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

[#7855] Attachment masking fixes #7856

Merged
merged 4 commits into from
Aug 11, 2023
Merged

[#7855] Attachment masking fixes #7856

merged 4 commits into from
Aug 11, 2023

Conversation

gbp
Copy link
Member

@gbp gbp commented Aug 11, 2023

Relevant issue(s)

Fixes #7855

What does this do?

Work around some of the common cases why the original attachment body can't be found.

Why was this needed?

Seemingly randomly broken pages and failed background jobs.

Implementation notes

Screenshots

Notes to reviewer

We're going to add additional contexts so refactor some specs tto add an
initial context.
We might have attachments in the database with the incorrect hexdigest.
If so we won't be able to find the original attachment body. This commit
adds a method which accounts for 2 scenarios which might cause the
hexdigest to change. 1. different line endings, 2 leading zeros on dates

Both of these changes have been caused by upstream changes to the mail
gem we use to parse the emails but this hasn't been apparent until
recently.
Now attempt to find the attachment by calculating the hexdigest based on
a number of possible difference that have been observed. See previous
commit.

Fixes #7855
Ensure we don't get stuck in the loop when masking jobs are already
queued.
@gbp gbp merged commit f0af37d into develop Aug 11, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ERROR] undefined method `gsub' for nil:NilClass lib/alaveteli_text_masker.rb:173
1 participant