#type error in socket.readyState

1 messages · Page 1 of 1 (latest)

random ginkgo
#

socket as in the tcp socket which we receive while connecting to tcp clients. const socket = await Bun.connect({...})

type defined as  readonly readyState: "open" | "closing" | "closed";

but the values of readyState are 1,2,3

    console.log({readystate:socket.readyState})

Can someone help me out ?

trail hornet
#

cc @ruby lark

ruby lark
#

Looking into it @random ginkgo

#

In this case I'm not sure what the correct values are, e.g. not sure if the bug is in the types or in Bun itself

random ginkgo
#

thanks for the reply

ruby lark
#

We'll get this fixed though

#

I think the correct value is to be a number