Skip to content

Why are volatile messages rapidly sent by the server not being received by the client? #3350

@GStipick

Description

@GStipick

You want to:

  • report a bug
  • request a feature

Current behaviour

When firing off multiple emits from the server, I am getting a behavior I was not expecting for volatile messages.

When I do a regular emit in rapid succession via a loop, all messages are received by the client and can be inspected via chrome network inspector. When I change to doing volatile.emit, I am only receiving the first message (of 100).

The question is, why is this the case?

Additionally, I noticed that if I had a 50ms delay to sending each volatile.emit message via setTimeout() then all messages are sent correctly (but of course with a delay). What factors go into this method working as expected, but not immediate volatile.emits working like regular emits?

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

Below is a link to a repo that is a setup of my test between volatile and non volatile messages. https://github.com/GStipick/socketioVolatileTest

Expected behaviour

From my understanding of: The Documentation for volatile messages , I would expect all of the messages to be sent, even if they are not received by the client. If they are indeed being sent, then why is emit able to be received for all messages, while volatile.emit is not?

Setup

  • OS: Windows 10 (Version 1803) [OS Build 17134.285]
  • browser: Firefox/Chrome
  • socket.io version: 2.1.1
  • node.js version: 10.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions