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

3242 all message recipients should be stored #3320

Merged
merged 9 commits into from
Jan 9, 2024

Conversation

bosiraphael
Copy link
Contributor

Closes #3242

  • This PR allows us to store every message recipient ("to", "cc", "bcc"). We used to store only the "from" for the POC.
  • We also store if the message is incoming or outgoing

@bosiraphael bosiraphael linked an issue Jan 9, 2024 that may be closed by this pull request
@bosiraphael bosiraphael requested a review from Weiko January 9, 2024 10:39
): AddressObject[] {
if (!addressObject) return [];

if (!Array.isArray(addressObject)) {
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
if (!Array.isArray(addressObject)) {
return Array.isArray(addressObject) ? addressObject : [addressObject];

[fromHandle],
);

const workspaceMemberId = workspaceMember[0]?.accountOwnerId;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const workspaceMemberId = workspaceMember[0]?.accountOwnerId;
const workspaceMemberId = workspaceMember[0]?.id;

I think you meant this?

[recipient.address],
);

const recipientWorkspaceMemberId = workspaceMember[0]?.accountOwnerId;
Copy link
Member

Choose a reason for hiding this comment

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

Same here, probably

Suggested change
const recipientWorkspaceMemberId = workspaceMember[0]?.accountOwnerId;
const recipientWorkspaceMemberId = workspaceMember[0]?.id;


const recipientWorkspaceMemberId = workspaceMember[0]?.accountOwnerId;

await manager.query(
Copy link
Member

Choose a reason for hiding this comment

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

nit: pgql should handle bulk insert

],
);

await this.saveMessageRecipients(
Copy link
Member

Choose a reason for hiding this comment

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

nit: We could probably mutualise this?

@bosiraphael bosiraphael requested a review from Weiko January 9, 2024 13:12
Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM

@Weiko Weiko merged commit bdd0a7e into main Jan 9, 2024
2 checks passed
@Weiko Weiko deleted the 3242-all-message-recipients-should-be-stored branch January 9, 2024 13:14
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.

All message recipients should be stored
2 participants