Skip to content

Downgrade engine_socket transport error "polling request overlap" to 4xx from 5xx #650

Closed
@pubudu08

Description

@pubudu08

Describe the bug

Hi Peeps,

I am facing an issue where the sockets are in polling mode, the engine io long-polling algorithm will error out when you have two open GET requests. As of now, the error is treated as 500 error.

This could happen when a client has a faulty configuration in place. So, I am proposing we should treat this error as 400/406/409 code where it is used to tell the client that a fault has taken place on THEIR side.

onDataRequest(req, res) {
if (this.dataReq) {
// assert: this.dataRes, '.dataReq and .dataRes should be (un)set together'
this.onError("data request overlap from client");
res.writeHead(500);
res.end();
return;
}

To Reproduce

The issue is similar to #166 but restricted to polling only. No upgrade to WebSocket is allowed in my case.

You can reproduce the issue in the following ways

  • Using a reverse proxy to proxy WebSocket reproduced
  • Use a browser(firefox) to block WebSocket transport reproduced
  • Using a socket client to proxy WebSocket: not-reproduced
    • transports: [ "polling"]

Once the browser shows the xhr requests(GET) as pending state, copy the request as curl. Execute the curl request via the terminal to reproduce the issue.

Engine.IO client version: 6.1.0

Expected behavior

it indicates a faulty implementation of the engine io long-polling algorithm when you have two open GET requests. The proposed Idea is that we could downgrade data request overlap from client error code listed below as 4xx error instead of 500

res.writeHead(500);

potential error codes - 400/406/409

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions