Skip to content
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

Make certain readyState is actually a number when returned #80

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

mstoykov
Copy link
Collaborator

What?

Fix readyState to be an actual Number in js

Why?

This is what the specification says.

For some reason - likely a bug in goja/Sobek returning a type that is uint8 under the hood (or int) doesn't actually get to be a number in js.

The current fix casts the ReadyState type to uint8 so that Sobek handles it correctly.

Fixes #79

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

for some reason - likely a bug in goja/Sobek returning a type that is
uint8 under the hood (or int) doesn't actually get to be a number in js.

The current fix casts the ReadyState type to uint8 so that Sobek handles
it correctly.

Fixes #79
@mstoykov mstoykov requested a review from a team as a code owner September 27, 2024 14:28
@mstoykov mstoykov requested review from olegbespalov and joanlopez and removed request for a team September 27, 2024 14:28
@mstoykov mstoykov requested a review from oleiade September 27, 2024 14:30
Copy link
Member

@oleiade oleiade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I might have stumbled upon this in the past 🤦🏻
🚀 🚀 🚀

@mstoykov mstoykov merged commit c8ce6f2 into main Sep 27, 2024
10 checks passed
@mstoykov mstoykov deleted the readyStateFix branch September 27, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Experimental Websocket readyState returned as a string
3 participants