Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Convert serialized posts to eml #5152

Merged
merged 4 commits into from
Jan 30, 2024
Merged

Convert serialized posts to eml #5152

merged 4 commits into from
Jan 30, 2024

Conversation

pandeyabs
Copy link
Contributor

@pandeyabs pandeyabs commented Jan 29, 2024

  • Add the serialized Postable to EML converter code for group mailboxes and associated tests.
  • We should converge this with Messageable code at some point with a small translator function which converts Postable to Messageable. Reason being that posts are a subset of messages. Although I feel it's a bit premature right now. Once we have tested this in prod a bit, and we know for a fact that posts are indeed a true subset of messages, we can do this convergence.

Does this PR need a docs update or release note?

  • ✅ Yes, it's included
  • 🕐 Yes, but in a later PR
  • ⛔ No

Type of change

  • 🌻 Feature
  • 🐛 Bugfix
  • 🗺️ Documentation
  • 🤖 Supportability/Tests
  • 💻 CI/Deployment
  • 🧹 Tech Debt/Cleanup

Issue(s)

  • #

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

Copy link
Contributor

aviator-app bot commented Jan 29, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.

Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@pandeyabs pandeyabs self-assigned this Jan 29, 2024
@pandeyabs pandeyabs added export All operations that deal with data export teams & groups Teams and Groups service and API functionality. labels Jan 29, 2024
@pandeyabs pandeyabs marked this pull request as ready for review January 29, 2024 08:10
@pandeyabs pandeyabs changed the title Convert serialized group mailbox posts to eml Convert serialized posts to eml Jan 29, 2024
Copy link
Member

@meain meain left a comment

Choose a reason for hiding this comment

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

... with a small translator function which converts Postable to Messageable ...

This would be better. I personally would have done this conversion as there are more gotchas in the eml conversion. We could always separate it out in case we find that Postable is not a subset.

Looking at the interface, these seem to be the functions that are in Postable but not in Messageable:

GetConversationThreadId()(*string)
GetInReplyTo()(Postable)
GetNewParticipants()([]Recipientable)

I'll however leave that decision up to you. The PR looks good to me.

@pandeyabs
Copy link
Contributor Author

Thanks @meain . I'll punt this for now. Here's a tech debt ticket. #5155

I had one question about the message -> EML code here.

	if data.GetSentDateTime() != nil {
		email.SetDate(ptr.Val(data.GetSentDateTime()).Format(dateFormat))
	}

Any reason we are using sent date time here and not received date time or last modified date time?
Asking because posts don't have sent date time field. So I am using received date time field as an alternative.

@meain
Copy link
Member

meain commented Jan 30, 2024

The spec mentions it to be the "sent" datetime. The idea is to have the datetime where it was "created".


3.6.1. The Origination Date Field

The origination date field consists of the field name "Date" followed
by a date-time specification.

orig-date = "Date:" date-time CRLF

The origination date specifies the date and time at which the creator
of the message indicated that the message was complete and ready to
enter the mail delivery system
. For instance, this might be the time
that a user pushes the "send" or "submit" button in an application
program. In any case, it is specifically not intended to convey the
time that the message is actually transported, but rather the time at
which the human or other creator of the message has put the message
into its final form, ready for transport. (For example, a portable
computer user who is not connected to a network might queue a message
for delivery. The origination date is intended to contain the date
and time that the user queued the message, not the time when the user
connected to the network to send the message.)

@pandeyabs
Copy link
Contributor Author

pandeyabs commented Jan 30, 2024

Thanks Abin! I'll change it to post.GetCreatedDateTime()

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

37.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@aviator-app aviator-app bot merged commit 1537db5 into main Jan 30, 2024
23 of 24 checks passed
@aviator-app aviator-app bot deleted the conv_export branch January 30, 2024 21:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
export All operations that deal with data export mergequeue teams & groups Teams and Groups service and API functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants