Skip to content

Add input data to processed messages#46

Open
SpartakusMd wants to merge 1 commit into
zenstruck:1.xfrom
SpartakusMd:feature/add-input-data-to-processed-messages
Open

Add input data to processed messages#46
SpartakusMd wants to merge 1 commit into
zenstruck:1.xfrom
SpartakusMd:feature/add-input-data-to-processed-messages

Conversation

@SpartakusMd

@SpartakusMd SpartakusMd commented Nov 12, 2023

Copy link
Copy Markdown
Contributor

Fixes #17

  • Uses symfony/serializer to normalize the message from the envelope.
  • Stores the data into the input field
  • Didn't work on tests yet, until it's confirmed the approach is good
image

@kbond

kbond commented Nov 14, 2023

Copy link
Copy Markdown
Member

Thanks for the PR @SpartakusMd! I'm quite swamped at the moment so I'll give it a proper review (and start working on the other issues) when I have a chance.

Curious about what you said in the issue:

It gives the possibility to process the data later

Using symfony/serializer makes this difficult to do, right? If this is a valid use case, I wonder if we shouldn't use messenger's serializer. Then, when the user wants to re-run the message, we should just be able to unserialize and send to the bus. To keep the info available in the UI, we'd unserialize the data (using the messenger serializer), then normalize (using symfony/serializer). I hope that makes sense...?

Comment thread templates/detail.html.twig
@Chris53897

Copy link
Copy Markdown
Contributor

Thanks for the PR. Look already promising.
And of course a rerun option would be great.

@aborza
aborza force-pushed the feature/add-input-data-to-processed-messages branch from 05ae1d4 to 5fd1238 Compare August 9, 2024 09:59
@aborza

aborza commented Aug 12, 2024

Copy link
Copy Markdown

The input appearance on details page:
Screenshot 2024-08-12 172731

@SpartakusMd
SpartakusMd marked this pull request as ready for review August 12, 2024 16:38
Comment thread src/History/HistoryListener.php Outdated
Comment thread composer.json Outdated
"require": {
"php": ">=8.1",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4.1|^7.0",

@aborza aborza Aug 13, 2024

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To include the following fix symfony/symfony#52852 for symfony serializer

@SpartakusMd
SpartakusMd requested a review from Chris53897 August 13, 2024 10:15
@SpartakusMd

Copy link
Copy Markdown
Contributor Author

@kbond what do you think about the implementation? We're using the fork now in production and improves a lot the debugging life.

@kbond

kbond commented Aug 22, 2024

Copy link
Copy Markdown
Member

Looks good, I'm going to be adding this bundle to an ap so I'll be able to test this out locally soon.

@SpartakusMd

Copy link
Copy Markdown
Contributor Author

@kbond I found an issue related to emails. If the email is sent via Messenger, it will also be captured and save to the database. The problem comes when the message contains attachments, they will also be serialized and saved to the database. I propose to clone the message before serializing and remove attachments from it. What do you think?

@SpartakusMd

Copy link
Copy Markdown
Contributor Author

In the end, I have added a new stamp DisableInputStoreStamp to disable saving the input.

@SpartakusMd

SpartakusMd commented Oct 16, 2024

Copy link
Copy Markdown
Contributor Author

Hello @kbond, did you have time to check the changes?

@kbond

kbond commented Nov 10, 2024

Copy link
Copy Markdown
Member

Hey @SpartakusMd!

Sorry for the delay - I haven't forgotten about this!

I'm pretty sure the next pre-release is going to require a migration because of #105 so feels like a good time to add this feature.

I think I'm going to add a global config to disable/enable the result storage by default, then add EnableResultStoreStamp/DisableResultStoreStamp (to use depending on your global config). Thinking we should do the same with this feature also (global config + EnableInputStoreStamp/DisableInputStoreStamp).

Also, for the Email attachment issue, could we detect when a field is binary (the case for attachments) and just replace with (binary)?

Thoughts?

@SpartakusMd

Copy link
Copy Markdown
Contributor Author

Hello @kbond, sounds good the config and stamps.

Regarding email attachment, I didn't find a way to eliminate binary fields from being saved in the DB.

@aborza
aborza force-pushed the feature/add-input-data-to-processed-messages branch from d913392 to cc9cde9 Compare November 25, 2024 09:43
@SpartakusMd
SpartakusMd force-pushed the feature/add-input-data-to-processed-messages branch from cc9cde9 to c95802a Compare November 25, 2024 13:59
@bendavies

Copy link
Copy Markdown

awesome feature!

@kbond kbond mentioned this pull request Dec 16, 2024
@SpartakusMd
SpartakusMd force-pushed the feature/add-input-data-to-processed-messages branch from f3a1b6a to ac39231 Compare January 13, 2025 13:18
@SpartakusMd

Copy link
Copy Markdown
Contributor Author

@kbond could we move forward with this PR? I would like to add some extra functionality on top of it and avoid piling all the changes in a single PR, which would make the review harder.

@Chris53897

Copy link
Copy Markdown
Contributor

@kbond friendly ping

@kbond

kbond commented Apr 9, 2025

Copy link
Copy Markdown
Member

Ak, sorry all, this keeps falling down my list. I do really want to see this feature!

@ruud-timmermans-solutions

Copy link
Copy Markdown

When is this PR estimated to be merged?
Would also love this feature.

@SpartakusMd
SpartakusMd force-pushed the feature/add-input-data-to-processed-messages branch 2 times, most recently from 6c240ab to 7353f82 Compare February 9, 2026 11:36
@SpartakusMd
SpartakusMd force-pushed the feature/add-input-data-to-processed-messages branch from 7353f82 to b79836a Compare March 10, 2026 15:39
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.

Include message data in the history

6 participants