Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notion of volatile message to the client #2003

Closed
grofit opened this issue Feb 13, 2015 · 9 comments
Closed

Add notion of volatile message to the client #2003

grofit opened this issue Feb 13, 2015 · 9 comments
Labels
enhancement New feature or request

Comments

@grofit
Copy link

grofit commented Feb 13, 2015

This was discussed on Slack, just wanted to capture it here incase it was not done so elsewhere.

The server has the notion of a message that it will try to deliver and if it fails it does not try again, as the message is deemed supplementary not mandatory. Currently the socket io javascript client does not have this notion so certain messages will back up which are not needing to.

In my scenario it is a ping to notify others that the person is still active, if one of these is missed it is not important, however if the server were to go down these messages back up and really you only need the latest one, not any previous ones, so it would be good to be able to mark them as volatile so any missed ones are ignored not backed up.

@dustMason
Copy link

👍

@rauchg
Copy link
Contributor

rauchg commented Apr 6, 2015

Will be in 1.4.0

@darrachequesne
Copy link
Member

That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible).

@grofit
Copy link
Author

grofit commented Jan 13, 2017

Has this been implemented? as if not I would still like to keep it open

@thoqbk
Copy link

thoqbk commented Apr 4, 2019

@darrachequesne is this the feature you want? Flag: ‘volatile’

@grofit
Copy link
Author

grofit commented Apr 4, 2019

It was years ago when I raised this, but yes the server can flag messages as volatile but the client does not have this notion I think, so when the client is sending messages to everyone in some cases you dont care if the message reaches them all, its more a UDP style fire and forget compared to the standard TCP "We deliver" approach.

As mentioned originally I think it was a case of a client sent out a "ping" message to all others in the channel to tell them they are still active and there, but if the server went down, the client isnt discarding the failed messages and keeps backing them up, so when the server comes back online it will send n amount of missed "ping" messages, but the expected behaviour would be it doesn't back them up, and they don't get resent.

@thoqbk
Copy link

thoqbk commented Apr 4, 2019

@grofit can you pass me some code to reproduce this? I have tried with chat app but cannot see this issue.
Following are steps:

  • Start server
  • Open 2 tabs (tab1, tab2) and start sending some messages
  • Stop server, go back to tab1, send 10 messages
  • Start server, tab2 will not receive 10 pending messages from tab1

Is there anything wrong with my test?

@grofit
Copy link
Author

grofit commented Apr 4, 2019

That seems fine, are you somehow marking those messages as volatile in the client, or letting the server know those messages should be fire and forget? as the behaviour you mention there was not the behaviour I was seeing when this was raised (granted this was 4 years ago).

If it seems to be working as expected feel free to close this

@darrachequesne
Copy link
Member

Closed by socketio/socket.io-client@7ddad2c and included in v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants
@rauchg @dustMason @nkzawa @grofit @thoqbk @darrachequesne and others