Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Stuck in connection state, multiple websocket connections openned. #46

@yoanncatalabt

Description

@yoanncatalabt

Hello everyone,
I am stuck using this package, which by the way seems to be nice and easy to use.
I am not able to connect to my broker using it.

imageThe client state is null
The connectionStatus is stuck in "Connecting"
Moreover, in the network tab, 3 WS connections are initiated (101 Switching protocols) to my broker.
Why are 3 connection openned ? I logged how many renders occurs, and there is only one render.

I tried to reproduce this package using plain JS with the same code, and i can tell that the problem seemed to by related to the mountedRef ref, which happen to never be equal to true when entering in all listeners (on.connect , on.reconnect, on.error , etc. ) and so, never setting up the client or updating the connectionStatus.
Maybe my issue is related to the ref.

By the way, the broker is fully working, as I was previously using plain mqtt package without no issues. Tested also with public mqtt brokers, same results.

If someone has an idea ?
Thanks a lot !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions