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

Fix: Header handling #165

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix: Header handling #165

wants to merge 2 commits into from

Conversation

mec
Copy link
Contributor

@mec mec commented Oct 18, 2024

This work sets out to resolve the two issues reported in #162 by @inulty-dfe.

We fix the first issue on the call to Hash.except.

We then stop the potential for duplicate headers ending up in the Mail::Message, by only sending the headers once to mail in view_mail.

This work will form the basis of v2.0.1

@coveralls
Copy link

coveralls commented Oct 18, 2024

Pull Request Test Coverage Report for Build 11403145272

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 11402636625: 0.0%
Covered Lines: 415
Relevant Lines: 415

💛 - Coveralls

@coveralls
Copy link

coveralls commented Oct 18, 2024

Pull Request Test Coverage Report for Build 12318805082

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 12318795481: 0.0%
Covered Lines: 415
Relevant Lines: 415

💛 - Coveralls

@mec mec force-pushed the fix/header-handling branch from 99db955 to dfb2447 Compare October 18, 2024 13:47
@mec mec force-pushed the fix/header-handling branch 2 times, most recently from a4db21f to c628284 Compare October 18, 2024 14:44
@mec mec marked this pull request as ready for review October 18, 2024 14:51
@mec mec marked this pull request as draft October 19, 2024 11:00
@mec mec force-pushed the fix/header-handling branch from c628284 to 7199a3d Compare December 2, 2024 12:45
mec added 2 commits December 13, 2024 15:51
The call to `except` here should not be an array as there is no array of
these symbol to exclude from the hash.

This issue was kindly identified by @inulty-dfe in #162.
With a view mail we have to call `mail` twice, once to get the body of
the email from the view and once again to override the format contents.

We were passing in any custom headers for both calls which was resulting
in duplicate headers in the message.

By calling `mail` without the headers, we can get the body and not
modify the headers, leaving that for the second call.

Interestingly adding custom headers is pointless, as they will never end
up in the email from Notify - we may want to stop messing with the
headers at all - I think it is a hangover from the v1 implementation.

This was kindly identified by @inulty-dfe in #162 who are testing the
header Mail::Fields that are potentially duplicated.
@mec mec force-pushed the fix/header-handling branch from 7199a3d to 462b703 Compare December 13, 2024 15:51
@mec mec marked this pull request as ready for review December 13, 2024 15:55
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.

2 participants