You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issues with using a websocket k6 typescript enum typeΒ #4540
Thanks for taking the time to report this, and cheers @Fernando-hub527 for putting some time into it. Before we start reviewing the PR though, I have a preliminary question: where is this EventName construct coming from?
A quick search didn't show any results in specifications around WebSockets and JS, so I'm a little bit confused. Also, going though the code of the experimental module, it doesn't seem to be a thing. Looking into websockets, it seems the first argument to addEventListener seems to be a static string, on par with the current implementation.
k6 tries to stick as strictly as possible to specifications, especially for protocols/technologies like WebSockets, thus, I'm wondering whether that's an implementation mishap/lack or whether that's a request to add a feature?
I'm definetly not a websockets expert so forgive my potential naivity, but the websockets module doesn't expose an EventName either as far as I can tell, and I genuinely wonder where this expectation came from in the first place; is it something we have documented somewhere? ππ»
PS: I will keep the issue in triage while we wait for clarifications
@oleiade Maybe I can help shed some light... the definition appears (already) in node_modules/@types/k6/experimental/websockets/index.d.ts
... which now that I read this more closely makes me think this issue should be filed over on the DefinitelyTyped repo? Unsure about who maintains each type definition over there with respect to each project!?
@joffotron I would suggest indeed to bring it to the DefinitelyTyped repo instead, as I don't think adding this type specifically to the k6 codebase's module adds value ππ»
Also, we maintain it. I believe the way to go would be to open a PR directly on the definitely typed repo, and their bot will ping maintainers automatically.
Activity
Fernando-hub527 commentedon Feb 21, 2025
Hi, I'm starting to contribute to K6 and would like to help with this issue.
oleiade commentedon Mar 26, 2025
Hey folks ππ»
Thanks for taking the time to report this, and cheers @Fernando-hub527 for putting some time into it. Before we start reviewing the PR though, I have a preliminary question: where is this
EventNameconstruct coming from?A quick search didn't show any results in specifications around WebSockets and JS, so I'm a little bit confused. Also, going though the code of the experimental module, it doesn't seem to be a thing. Looking into websockets, it seems the first argument to addEventListener seems to be a static string, on par with the current implementation.
k6 tries to stick as strictly as possible to specifications, especially for protocols/technologies like WebSockets, thus, I'm wondering whether that's an implementation mishap/lack or whether that's a request to add a feature?
I'm definetly not a websockets expert so forgive my potential naivity, but the websockets module doesn't expose an
EventNameeither as far as I can tell, and I genuinely wonder where this expectation came from in the first place; is it something we have documented somewhere? ππ»PS: I will keep the issue in triage while we wait for clarifications
joffotron commentedon Apr 4, 2025
@oleiade Maybe I can help shed some light... the definition appears (already) in
node_modules/@types/k6/experimental/websockets/index.d.ts... which now that I read this more closely makes me think this issue should be filed over on the DefinitelyTyped repo? Unsure about who maintains each type definition over there with respect to each project!?
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/k6/experimental/websockets/index.d.ts#L210-L240
oleiade commentedon Apr 10, 2025
@joffotron I would suggest indeed to bring it to the DefinitelyTyped repo instead, as I don't think adding this type specifically to the k6 codebase's module adds value ππ»
Also, we maintain it. I believe the way to go would be to open a PR directly on the definitely typed repo, and their bot will ping maintainers automatically.