-
Notifications
You must be signed in to change notification settings - Fork 939
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
Message#== - comparison strategy #1529
Comments
If both messages have ids, the == method invokes encoded without first creating a copy. This changes the original instance, which does not seem right. It would be better to always create a duplicate. |
There are currently two tests which check that a provided message-id compares equal with nil. mail/spec/mail/message_spec.rb Line 1719 in bf02b67
and mail/spec/mail/message_spec.rb Line 1730 in bf02b67
|
Allowing Message-Id to match against nil causes unexpected behaviour for the == operator See #1540 At present, Message equality (==) is not transitive. |
The == method has to generate dummy message-ids if none exist.
As it stands, if either message does not have an id, then both are set to the same fixed value.
This seems fine for the case where neither message has an id, but is it the best strategy when one already has an id and the other does not?
Similarly for Dates (see #1527)
The text was updated successfully, but these errors were encountered: