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

Don't add activity and reference fields to outgoing message #1707

Conversation

Naktibalda
Copy link
Contributor

I noticed that Botkit adds some garbage fields to outgoing fields, e.g. {"type":"message","text":"Hi...","channelId":"websocket","conversation":{"id":"98f515de-b10a-4b4c-51b9-d6fa3f0e1688"},"from":{"id":"bot"},"recipient":{"id":"98f515de-b10a-4b4c-51b9-d6fa3f0e1688"}}

So I decided to remove them.

Previous activity check was incorrect and allowed falsy values to be added to channelData.
Reference fields weren't checked at all so they were sent to client.

Previous activity check was incorrect and allowed falsy values to be added to channelData.
Reference fields weren't checked at all so they were sent to client.
@Naktibalda Naktibalda force-pushed the bugfix/remove-framework-fields-from-message branch from 8c2b05f to f3f714e Compare July 3, 2019 16:13
@Naktibalda
Copy link
Contributor Author

Actually, I don't like this patch anymore,
I think that applyConversationReference call
at https://github.com/howdyai/botkit/blob/master/packages/botkit/src/botworker.ts#L136 is completely unnecessary, because the next step strips those fields.

@Naktibalda
Copy link
Contributor Author

I copied the good part of this change to #1708

@Naktibalda Naktibalda closed this Jul 3, 2019
@Naktibalda Naktibalda reopened this Jul 3, 2019
@Naktibalda
Copy link
Contributor Author

Another U-turn, I realized that this change was good.

@benbrown
Copy link
Contributor

This fix has been indirectly incorporated into 4.5! Thanks for the contribution!

@benbrown benbrown closed this Jul 24, 2019
@Naktibalda
Copy link
Contributor Author

Thanks, I upgraded to 4.5 and it is working as expected.

@Naktibalda Naktibalda deleted the bugfix/remove-framework-fields-from-message branch July 25, 2019 07:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants