Skip to content

setTimeout to emit drain in websocket.js:175 causes following message delayed 1s when tab in background #649

@zyf0330

Description

@zyf0330

You want to:

  • [] report a bug
  • [x ] request a feature

Current behaviour

When using Chrome or Safari and putting tab into background, timer is delayed to ensure at least 1s interval. And it causes that
later message is delayed 1s.

Steps to reproduce (if the current behaviour is a bug)

  1. write a simple client which sends two messages to server every 1s and run in browser
  2. put browser tab into background
  3. put it back into foreground

Expected behaviour

sent message is not delayed

Setup

  • OS: Ubuntu
  • browser: Chrome
  • engine.io-client version: 4.0.5

Other information (e.g. stacktraces, related issues, suggestions how to fix)

I try to remove this setTimeout but connection is disconnected. So I want to know if setTimeout can be removed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions