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
Handle parsing of LF-only body with separate parts #1511
Conversation
Conversion of body to CRLF does not help here because body is not ascii_only so does not get converted. Instead to search for CR?LF (optional CR) in which case conversion to CRLF is unnecessary.
I tried to reproduce the error in jruby-9.2, but so far have failed. It looks like the failure is intermittent. Perhaps you could try triggering another test run in this fork and see what happens? |
Hey there @sebbASF how annoying, intermittent failures are the "best"! :) Could you please go ahead and add the workflow_dispatch and I'm going to ping Charles and see if he has any ideas on this, because it's a core change to our parser, I want to try and get to the bottom of it. |
Added manual trigger in PR#1518 I just tried setting up a workflow in my fork that runs the tests 4 times in succession for 9.3 and 9.2, and both failed with new errors. 9.3 failed with: Failure/Error: ::YAML.safe_load(yaml, :permitted_classes => permitted_classes)
9.2 - Ruby installation failed. Looks like some dependencies may have changed? |
In the current builds I can only see 9.2 errors. They range across several tests and I'm not sure if there's a common cause. If you can isolate them to specific reproductions the next step would be filing some JRuby issues. If you can point me at the intermittent 9.3 tests I can have a look into that. |
I don't think there is any point trying to solve this issue yet, given the problems with setting up tests that started recently. See https://github.com/mikel/mail/actions for plenty of examples of tests which fail during setup of Ruby. If anyone can solve that problem, it would help lots of projects! |
Psych 5.0.0 needs libyaml-dev; AIUI this is to be expected. However on JRuby, tests then fail because the method _native_parse cannot be found. As a work-round, see #1520, which attempts to trigger test failures. |
Aha! Ok so there's just some Psych 5 updates we need to make for JRuby. |
#1518 now also fixes the Psych 5.0.0 error for JRuby. However there is still the issue of occasional test failures. It looks like there might be an issue with the handling of == in the objects that are being compared. |
The |
I don't know of anything in JRuby that would cause
My guess would be that the |
Note that I saw a similar error once in non-JRuby test. I agree that this is highly unlikely to be an issue in the underlying Ruby implementation. Unfortunately failures are quite rare, which makes it much harder to debug (and harder to prove that a change fixes it). |
Psych 5.0.1 has been released, fixing the |
See #1527 - this looks to be the cause of the occasional errors. It is a timing issue, which is why the errors are infrequent. |
Feature/parse lf
@mikel hi! i was looking for info about when i might see the change in the PR in an official context: i maintain the as2 gem. AS2 messages are MIME messages, so we use # before this PR...
require 'mail'
mail = Mail::Body.new("new\nbody")
mail.raw_source
# => "new\r\nbody" <------- note additional "\r"
# after this PR...
require 'mail'
mail = Mail::Body.new("new\nbody")
mail.raw_source
# => "new\nbody" The change in this PR fixes the issue, so I'm hoping to find out when I can start using it in |
can be removed once mikel/mail#1511 is released after that, the mail gem will no longer transform \n into \r\n (which breaks signature verification).
Original PR #1319
Conversion of body to CRLF does not help here because body is not ascii_only so does not get converted. Instead to search for CR?LF (optional CR) in which case conversion to CRLF is unnecessary.