-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove BaseEventEmitter from components #4191
Conversation
b7fde0d
to
f61bad6
Compare
f61bad6
to
255050e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not needed 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that somehow "publicly" exposed? Like, can it be somehow used by k6 users?
Or those events are only being consumed internally by other components?
@@ -661,7 +661,7 @@ func (fs *FrameSession) onConsoleAPICalled(event *cdpruntime.EventConsoleAPICall | |||
} | |||
|
|||
func (fs *FrameSession) onExceptionThrown(event *cdpruntime.EventExceptionThrown) { | |||
fs.page.emit(EventPageError, event.ExceptionDetails) | |||
// TODO: Test and handle this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I'm getting this todo and also, does that make sense to have this empty body method at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, i think we need an issue for this as it may be something useful to build an API around. When the website throws an exception then the user might want to track this.
I don't want to delete it. Instead i might add some debug logging when this is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, yeah logging that sounds reasonable, feel free to do this later, but it's worth maybe updating TODO within this PR to put more context for the future implementation 👍
@joanlopez These are all internal events, nothing exposed to the k6 user. |
38d7d79
to
4d7a59f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, like I said in-line it's worth providing more context for TODO, like Why?
and optionally What?
, but consider this non-blocking for merge
The event that is emitted is never received anywhere else in the codebase. Simplify the exec and code by removing the BaseEventEmitter.
The emitter is never used to emit anything. So remove it to simplify the codebase.
Nothing is receiving the event when the session is closed.
The events which are emitted with the page's event emitter instance weren't being received by anything else in the codebase.
d8a6212
to
638eb16
Compare
What?
Removing the BaseEventEmitter from
Touchscreen
,Page
andWorker
, as well as the events which are emitted.Why?
While debugging another issue i found that these components had instances of their own event emitter, which were emitting events, but nothing was consuming them. It's confusing to see these events being emitted and can cause confusion while debugging issues with the event emitter. This is why they are being removed.
Checklist
make lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)