Skip to content

Fix connect() SocketOptions type#2244

Open
DaniFoldi wants to merge 1 commit intocloudflare:mainfrom
DaniFoldi:connect-socketoptions-type
Open

Fix connect() SocketOptions type#2244
DaniFoldi wants to merge 1 commit intocloudflare:mainfrom
DaniFoldi:connect-socketoptions-type

Conversation

@DaniFoldi
Copy link
Copy Markdown
Contributor

Hi 👋,

I noticed that while the internal sockets type definitions https://github.com/cloudflare/workerd/blob/main/src/cloudflare/internal/sockets.d.ts and docs https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/#socketoptions
both type secureTransport as a proper enum, and say allowHalfOpen is optional, the generated types don't reflect this: https://workers-types.pages.dev/4.20240605.0/#SocketOptions

This PR is my attempt to fix this, although unlike my previous types fixes, this one was one bit more complicated so if it's using the wrong macro or missing a semicolon, apologies, I'll happily fix - compiling didn't work locally so my only source of confidence is the GH Action run on my fork.

Additionally, I found that somehow the copyright and license comment from only vectorize.d.ts is included: see just below https://workers-types.pages.dev/4.20240605.0/#webSocketError.connect, and while this is by no means important, it's annoying me that I couldn't yet find the reason.

@DaniFoldi DaniFoldi requested review from a team as code owners June 9, 2024 21:05
Copy link
Copy Markdown
Contributor

@dom96 dom96 left a comment

Choose a reason for hiding this comment

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

Comment thread src/workerd/api/sockets.h
@DaniFoldi DaniFoldi force-pushed the connect-socketoptions-type branch from aba8469 to 04dae05 Compare June 11, 2024 17:20
@DaniFoldi DaniFoldi force-pushed the connect-socketoptions-type branch from 04dae05 to 8262af9 Compare June 24, 2024 09:59
@DaniFoldi DaniFoldi force-pushed the connect-socketoptions-type branch from 8262af9 to 9cb13df Compare May 3, 2026 07:33
@DaniFoldi
Copy link
Copy Markdown
Contributor Author

Hi, I completely forgot about this PR; I've rebased it and I think I found the reason why it couldn't compile last time.

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.

3 participants