Skip to content

TransformUrl function returns a async promise instead of new url string #828

@mxdi9i7

Description

@mxdi9i7

I'm trying to request for a new signed url from a server that already signs the url, the operation is async and by returning the promise I wasn't able to have the MQTT socket connected (it was never connected, went straight to offline).

mqtt.connect({
      protocal: 'ws',
      transformWsUrl: () => {
        return renewStreamUrl(endpoint, token, conversationId) //this is an async operation
      }
    }
  )

The websocket just starts to reconnect nonstop with a new url.

The expected behavior is: transformUrl callback returns a resolved promise, which in my case is the signed url, but it seems like its only returning a wrapped Promise which causes my mqtt client to reconnect nonstop because it didn't find a valid stream URL

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions