Remove full event details from UnmarshallingErrorEvent #1067
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.
Hi 👋
When an unknown Slack event is received (e.g. unsupported Huddle-related events like
user_huddle_changed
orsh_room_join
), the library sendsUnmarshallingErrorEvent
containing full event details data, including some pieces of personal information about the user.This is a part of this error message when calling
err.Error()
on suchslack.UnmarshallingErrorEvent
:It is a problem, because such error should be presented to a user in some way. As this is a string, it needs some string manipulation to remove the event details. I think it shouldn't work that way.
While there are different options to solve this, I went with the simplest option: do not concatenate the event details to the error message 🙂 It brings consistency across all errors that are returned as incoming events. Also, there is still debug logging around UnmarshallingErrorEvents, so basically the change doesn't impact anything.
Let me know what you think 🙂 Cheers!