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

Websocket connection doesn’t get messages on subscription after terminated reconnect #645 #1227

Closed
usernametaken opened this issue Apr 15, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@usernametaken
Copy link

commented Apr 15, 2019

  1. I am running mosquitto 1.5.8 (Windows)
  2. I am connecting using websockets
  3. I am having a similar issue to #645 (#645)
  4. I connect with a Fixed ClientID
  5. CleanSession = False (with CleanSession = True ... no problem)
  6. QoS is irrelevant to the problem (I tried all levels)

a) I start my application connect, subscribe and publish... everything works fine
b) I kill my application without sending a DISCONNECT first
> Socket error on client Client1, disconnecting
Everything works fine

c) I send a DISCONNECT before disconnecting :-( The problem starts
After Reconnecting , and subscribing to the same Topic,
I don't receive PUBLISHed messages anymore
d) If I kill my client application and start again.... It still does not work.
e) If I stop and restart mosquitto ... reconnect and subscribe (with or without restarting the client)... everything works.

Doing the same with a TCP client... all works fine

@ralight

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

Thanks for the easy to follow steps. I confirm this is behaving as you state. It's a bit involved to fix, so won't be part of 1.6.

@usernametaken

This comment has been minimized.

Copy link
Author

commented Apr 16, 2019

Thanks... I am fine for now.
As a workaround I just don't send DISCONNECT before disconnecting, if CleanSession is false,
... I simply close the socket.

@ralight

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

Yes that works - as long as you don't want to control whether a Will is sent or not, which is why I didn't suggest it as the solution.

@ralight

This comment has been minimized.

Copy link
Contributor

commented May 28, 2019

I've just pushed a fix for this to the fixes branch. If you feel you can give it a try and report back that would be great. It turns out the fix wasn't as involved as I thought, which is good.

@ralight ralight added this to the 1.6.3 milestone May 28, 2019

@ralight ralight closed this in 5088202 Jun 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.