Skip to content

fix(eio): make _query optional in EngineRequest#5495

Open
elementnl wants to merge 1 commit intosocketio:mainfrom
elementnl:fix/engine-request-optional-query
Open

fix(eio): make _query optional in EngineRequest#5495
elementnl wants to merge 1 commit intosocketio:mainfrom
elementnl:fix/engine-request-optional-query

Conversation

@elementnl
Copy link
Copy Markdown

Fixes #5468

EngineRequest declared _query as required, but the property is set lazily by prepare() and doesn't exist on a raw IncomingMessage. This caused a TypeScript error when passing a plain IncomingMessage where an EngineRequest is expected; for example, in Nuxt integrations following the official guide.

Before: Any code that worked with EngineRequest directly would get a TypeScript mismatch error because _query was required but not present on the underlying IncomingMessage.

After: _query is typed as optional in EngineRequest and in the Transport constructor, which correctly reflects the lifecycle of the property: it may not be set at construction time, but is always guaranteed to be present by the time any transport logic runs. transports/index.ts is also updated for consistency.

No tests added - this is a TypeScript-only change with no runtime behavior difference.

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.

[engine.io] _query should be optional

1 participant