Skip to content

GetSubscriptions: Client hangs indefinitely when refresh token and Wrong scopes are provided. #227

@coolapso

Description

@coolapso

Hi, Apologies if this is the wrong place for this, but not entirely sure where to start.

Recently I found out the client gets hung and never returns a response when using the Get Subscriptions method while having the client setup with A refresh token and a wrong Scope.

How to reproduce:

Generate a new access token, ie using Twitch cli or your favorite method, with the scope [user:read:subscriptions]
Create a new helix client and provide The following Options: UserAccessToken, ClientID and ClientSecret
Make a client.GetSubscriptions() request, response should be returned, with wrong scope error
Add the refresh token to your client options
Make a new request, observe client get hung indefinitely and never return a response.

Sample code:

package main

import (
	"fmt"
	"log"
	helix "github.com/nicklaw5/helix/v2"
)


const (
	userID = "YourUserIDHere"
)

func main() {
 	client, err := helix.NewClient(&helix.Options{
		UserAccessToken: "UserAccessToken",
		RefreshToken: "RefreshToken",
		ClientID: "ClientID",
		ClientSecret: "ClientSecret",
	})
	if err != nil { 
		log.Fatal("Failed to create new client:", err)
	}

	resp, err := client.GetSubscriptions(&helix.SubscriptionsParams{
		BroadcasterID: userID,
	})
	if err != nil {
		log.Fatal("Failed to get subs:", err)
	}

	fmt.Println(resp)
}

Hope I'm providing everything you need to track this down. Let me know if you need more details and if I can somehow help.

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