Skip to content

Tries to reconnect with invalid token #82

Description

@lukasz-kalnik-gcx

If the connection is lost the library automatically tries to reconnect.
However, if one of the initial Socket params was an access token and the token expired in the meantime it will nevertheless be reused for the reconnect attempt. This leads to the server not accepting the reconnect requests.

We need some way to take over the reconnect strategy in the library client. Either a callback where we can pass new parameters or a way to disable the reconnect and handle it ourselves.

Activity

  1. dsrees commented on Apr 20, 2021

    @dsrees
    Owner

    0.5.0 released with this. Readme has been updated with an example as well.

    // Create the Socket
    var authToken = "abc"
    val socket = Socket("http://localhost:4000/socket/websocket", { mapOf("token" to authToken) })

    Test example can be found here

  2. lukasz-kalnik-gcx commented on Apr 20, 2021

    @lukasz-kalnik-gcx
    Author

    Thank you so much for your quick reaction and your effort! I will test it immediately 🙏

  3. dsrees commented on Apr 20, 2021

    @dsrees
    Owner

    👍🏼 of course! It was a feature in the SwiftPhoenixClient already that I had forgotten to port over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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