Skip to content

Connection resumed after long downtime, but no messages received #475

Closed
@raRaRa

Description

@raRaRa

Describe the bug

My issue is 100% like #117 which is now closed.

  1. Network is down for over several hours, and then it goes back up and resumes the MQTT connection.
  2. Everything looks normal but the client never recieves any messages. Kinda as if the subscription got lost?

Based on the information on the old issue that I referenced, it says I need to manually re-subscribe if session_present is false when the connection is resumed in connection_success My initial thought was that this library would handle the re-connection by itself.

I tried debugging the internal state and saw that the connection_count increases with time, when network is down and goes up after several hours. Is it because a new session was created?

I would love to have more information on this.

Thanks!

Expected Behavior

I expected the connection to resume without any silent failure.

Current Behavior

The connection is resumed but no messages are received

Reproduction Steps

  1. Connect to MQTT and subscribe to a topic
  2. Turn off the network on the PC for 2-4 hours
  3. Turn on the network on the PC
  4. Whe connection is resumed, note how the client recieves no messages. Also note that session_present is false in connection_success

Possible Solution

Re-subscribe to the topics automatically if re-connection is handled by this SDK.

Additional Information/Context

Using browser version

SDK version used

1.19.1

Environment details (OS name and version, etc.)

Browser Chrome on MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p3This is a minor priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions