[FIX] Apps converters delete fields on message attachments#14028
Merged
[FIX] Apps converters delete fields on message attachments#14028
Conversation
Member
|
@d-gubert how this handle fields removal? If I unset, like, attachments from inside the engine? |
Member
This may answer my question: |
rodrigok
reviewed
Apr 7, 2019
Member
Author
|
Discussing with @sampaiodiego and @tassoevan we found a more elegant solution. I'll be closing this PR for now until I have implemented it. |
Member
|
The code looks good, just missing some unit tests 😄 |
Member
Author
|
Added some tests. Some of the mocks are kind of generic and maybe could be moved to a better place? What do you think @rodrigok? 🤔 |
rodrigok
approved these changes
Apr 16, 2019
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Whenever a message is sent over to the apps engine to trigger a hook, the message converter that bridges the data from Rocket.Chat to the Engine does not take all the fields from the original object to the converted one.
When data comes back from the Engine, it was not being merged back to the message object properly, which was causing the attachments (and any other non-primitive value) to lose some of the fields.
With these changes, fields that are ignored by the Engine will no longer be deleted from the message's attachments.
Closes #12691