RocketChat / Rocket.Chat.Go.SDK

Go SDK for REST API and Realtime api
MIT License
59 stars 58 forks source link

Subscription returned a nosub error map[id:3 msg:nosub] #44

Open mosskin-woast opened 3 years ago

mosskin-woast commented 3 years ago

Using the Client.Sub method to subscribe to stream-room-messages for a new room returns this error: Subscription returned a nosub error map[id:3 msg:nosub]. Here's an example:

info, err := client.GetInitialData(token)
if err != nil {
  return err
}

visitor, err := client.CreateGuest(token, fullName, email, department)
if err != nil {
  return err
}

log.Printf("Visitor created: %+v\n", visitor)

deskMessage := fmt.Sprintf("Visitor %s joined the chat:\n**%s**", fullName, message)
err = client.SendMessage(deskMessage, token, roomID)
if err != nil {
  return err
}

// subscribe to room updates
  channel, err := client.Sub("stream-room-messages", roomID)
  if err != nil {
  return fmt.Errorf("failed to subscribe to room updates: %w", err)
}

I am having a hard time determining if this is an issue with the SDK, the Go DDP implementation or a breaking change in RocketChat itself. Any help is appreciated.