Skip to content

Body text goes missing when using add_file#1539

Open
balvig wants to merge 1 commit intomikel:masterfrom
balvig:jb/body-text-goes-missing-when-using-add_file
Open

Body text goes missing when using add_file#1539
balvig wants to merge 1 commit intomikel:masterfrom
balvig:jb/body-text-goes-missing-when-using-add_file

Conversation

@balvig
Copy link
Copy Markdown

@balvig balvig commented Dec 13, 2022

This is just a failing test so far, as I'm not sure if this is actually a problem or I'm just doing something wrong! 🙇

It seems that since v 2.8, using add_file causes the body text to go missing:

m = Mail.new
m.body = "Body text"
m.body.to_s # => "Body text"

m.add_file(:filename => "attachment.data", :content => "a")
m.body.to_s # => ""

Am happy to try and fleshing this out to a fix, but wanted to first double check whether this is indeed expected behavior of not.

The behavior does not seem to occur in 2.7.

@balvig balvig marked this pull request as ready for review December 13, 2022 14:46
balvig added a commit to ActiveCampaign/postmark-gem that referenced this pull request Dec 13, 2022
## What

Locks the `mail` dependency to `~> 2.7.0`

## Why

`v 2.8.0` of the mail gem is causing [tests to
fail](https://app.circleci.com/pipelines/github/ActiveCampaign/postmark-gem/115/workflows/98f981da-bff4-4abb-b0ad-eaeb8045e873).

Currently investigating here mikel/mail#1539,
but since it's just a development dependency we can lock the version to
the CI back to green for now.
@sebbASF
Copy link
Copy Markdown
Contributor

sebbASF commented Dec 14, 2022

It’s rather odd that the truffleruby head build succeeded.

balvig added a commit to ActiveCampaign/postmark-gem that referenced this pull request Oct 11, 2023
## What

Alternate workaround to #135 and #143.

## Why

While there still seems to be an [issue with `add_mail` "clearing"
`body`,](mikel/mail#1539) instead of locking the
gem for all ruby version and making it difficult to test newer ones, we
can limit the version restrictions to legacy version and use this
workaround of flipping the order for Ruby 2.x.
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