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

[10.x] Allow serialization of NotificationSent #47375

Merged
merged 4 commits into from
Jun 13, 2023

Conversation

cosmastech
Copy link
Contributor

@cosmastech cosmastech commented Jun 8, 2023

To close #47372

  • Serialize SentMessage
  • Do not double serialize/encode SentMessage within MessageSent
  • Test serializing/unserializing SentMessage
  • Test serializing/unserializing MessageSent This is covered adequately by serializing MessageSent, but can add another test if requested.

MessageSent handily serializes and unserializes the raw message data (contained within SentMessage, which relies on Symfony's SentMessage class).

Since Illuminate's SentMessage is common to both MessageSent and NotificationSent, I thought it would make sense to move the base64 encoding/decoding and serialization of Symfony's SentMessage to Laravel's SentMessage class.

BTW, these names are confusing as hell to talk about, let alone work on. 😆

@cosmastech cosmastech marked this pull request as draft June 8, 2023 02:58
'data' => base64_encode(serialize($this->data)),
'hasAttachments' => true,
] : [
return [
'sent' => $this->sent,
Copy link
Member

Choose a reason for hiding this comment

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

This never needs to be base 64 encoded and serialized anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Admittedly, I don't know all of the use cases here, but my thinking is: if SentMessage is being base64_encoded for attachments when it is serialized, then there's no need to encode it again when MessageSent is being serialized.

Do you see a flaw in that thinking?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that could be true.

@cosmastech cosmastech marked this pull request as ready for review June 9, 2023 18:13
@driesvints driesvints requested a review from taylorotwell June 12, 2023 09:23
@taylorotwell taylorotwell merged commit 2577300 into laravel:10.x Jun 13, 2023
@cosmastech cosmastech deleted the serializable-sent-message branch June 27, 2023 16:22
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.

Unable to queue NotificationSent event listener for notifications with attachments
2 participants