Correct inaccurate event model relationships#1777
Merged
Conversation
st0012
commented
Mar 29, 2022
| # This is an abstract class that defines the shared attributes of an event. | ||
| # Please don't use it directly. The user-facing classes are its child classes. | ||
| class Event | ||
| TYPE = "event" |
Contributor
Author
There was a problem hiding this comment.
@sl0thentr0py By giving all events a default "event" type, I think we can remove many fallback code that deals with nil type. I think the events can still be accepted without any issue. Let me know if that'll cause any problem?
Member
There was a problem hiding this comment.
oh yea that's perfect, this always felt like a code smell
| @@ -71,8 +69,6 @@ def initialize(configuration:, integration_meta: nil, message: nil) | |||
| @rack_env_whitelist = configuration.rack_env_whitelist | |||
|
|
|||
| @message = (message || "").byteslice(0..MAX_MESSAGE_SIZE_IN_BYTES) | |||
Contributor
Author
There was a problem hiding this comment.
Ideally, message should be moved to ErrorEvent as well. But since that'll require changing Event#initialize as well and doesn't provide much benefit. I decided not to go this far.
sl0thentr0py
approved these changes
Mar 29, 2022
Member
sl0thentr0py
left a comment
There was a problem hiding this comment.
nice and clean! don't see any obvious problems
Since all event will now have "event" type by default, the fallback logics aren't needed anymore.
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.
As described in #1776 and discussed in #1773, error events shouldn't be the parent of transaction events. They're both variants of the core event type with their unique attributes. So this PR corrects the currently inaccurate inheritance relationship.
Close #1776