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

Provide cc support #38

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

LaithSaq
Copy link

@LaithSaq LaithSaq commented Feb 12, 2025

Related issue #37

This pull request expands on the EmailMessage API to support CCs. This is done by levereging the CCs property provided by MimeMessage.

We also updated the elastic search document to support logging the new CC property.

@LaithSaq
Copy link
Author

LaithSaq commented Feb 12, 2025

Note: Commit 2772fef only contains a question and need to be dropped before merging

@LaithSaq LaithSaq marked this pull request as draft February 12, 2025 11:11
@LaithSaq LaithSaq marked this pull request as ready for review February 12, 2025 11:12
Copy link

@MiaMark MiaMark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, assuming you are able to test and resolve the question in the first file.

@leo-labs
Copy link
Member

@LaithSaq Can you please fix your line ending settings and rebase, so there are no unnecessary line ending changes in the changeset?

@LaithSaq
Copy link
Author

LaithSaq commented Mar 12, 2025

Can you please fix your line ending settings and rebase, so there are no unnecessary line ending changes in the changeset?

That's me actually "fixing" the line endings. I set my git client to checkout Windows style (CRLF) and commit Unix style (LF). The unnecessary changes you're noticing are caused by the fact that files didn't have consistent line endings to being with. Do you suggest I re-use CRLF in files that originally used that?

UPDATE:
I've created this commit 89bc8f7 to undo line ending changes. If you prefer the current version, I can just squash it with the commit that introduced such changes, otherwise, I'll just drop the new commit :P

UPDATE:
I just did the squashing I mentioned above, along with some other commit history cleaning.

Line endings were not changed within this formatting to avoid
making the change log huge for reviewing purposes.
@LaithSaq LaithSaq force-pushed the provide-cc-support branch from 89bc8f7 to 57bfae0 Compare March 12, 2025 16:01
tags: f.Lorem.Words().ToList()
));

private static List<(string name, string address)> GenerateRandomCcList(Faker f) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private methods should be lower case

));

private static List<(string name, string address)> GenerateRandomCcList(Faker f) {
var count = f.Random.Int(0, 4);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should have randomness like this in tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to have variable instance lengths to account for different cases. But maybe that's a bit over engineering. Do you think 3 is a good count here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make these cases explicit instead?

@@ -52,6 +54,7 @@ public EmailMessage(Guid id, (string name, string address) from, (string name, s
Id = id;
From = from;
To = to;
Cc = cc;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not have CC be nullable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the immutability story in this class is not great, but no need to fix it now in this MR.

@@ -4,7 +4,7 @@
<TargetFramework>net6</TargetFramework>
<WarningAsErrors>true</WarningAsErrors>
<PackageId>MiddleMail</PackageId>
<Version>0.4.0</Version>
<Version>0.5.0</Version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I beleive you need to bump a few more versions than only this one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense, I guess I didn't think about that thoroughly, my bad

@LaithSaq LaithSaq force-pushed the provide-cc-support branch from 7dac281 to d68d833 Compare March 19, 2025 13:10
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.

3 participants