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

[#7971] Update attachment processing #8003

Merged
merged 1 commit into from
Nov 10, 2023
Merged

[#7971] Update attachment processing #8003

merged 1 commit into from
Nov 10, 2023

Conversation

gbp
Copy link
Member

@gbp gbp commented Nov 9, 2023

Relevant issue(s)

Fixes #7971

What does this do?

Update attachment processing

Handle when incoming messages are re-parsed which can cause attachments to be rebuilt when trying to render the main body part.

Why was this needed?

Occasionally when main body attachment part will get rebuilt while the content is masked. When this happens we can see errors such as: undefined method `unmasked_body' for nil:NilClass.

Implementation notes

This change ensures the masking job doesn't fail and the code will now raise an MissingAttachment exception instead.

Rescuing from this in IncomingMessage#get_main_body_text_internal allows us to retry straight away as in the second attempt the main part will be the new attachment instance and the part will be rendered.


[skip changelog]

Handle when incoming messages are re-parsed which can cause attachments
to be rebuilt when trying to render the main body part.

Occasionally when main body attachment part will get rebuilt while the
content is masked. When this happens we can see errors such as:
`undefined method `unmasked_body' for nil:NilClass`.

This change ensures the masking job doesn't fail and the code will now
raise an `MissingAttachment` exception instead.

Rescuing from this in `IncomingMessage#get_main_body_text_internal`
allows us to retry straight away as in the second attempt the main part
will be the new attachment instance and the part will be rendered.

Fixes #7971
@gbp gbp merged commit e82c426 into develop Nov 10, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ERROR] request#show "undefined method `unmasked_body' for nil:NilClass
1 participant