You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EventSubListener fails to subscribe to topics when it has previously failed more than one (different) subscription due to the token missing proper scopes. Yeah, not the most understandable sentence - let's give some examples, supposing we're trying to subscribe to topics A, B and C, each requiring certain scope:
Case 1: token has all 3 scopes -> all subscriptions succeed (as expected)
Case 2: token has scopes B and C, but not A -> subscriptions A fails, subscriptions B and C succeed (as expected)
Case 3: token only has scope C -> all 3 subscriptions fail, when subscription C should have succeed. The error thrown when trying to subscribe to C yells about scope B missing. So somewhere there is some cache or whatever once 2 subscriptions have failed that cause further subscriptions to fail too.
Code
Using a minimal setup:
constauthProvider=newRefreshingAuthProvider({ clientId, clientSecret });authProvider.addUser(broadcasterId,tokenData);constapiClient=newApiClient({ authProvider });consteventsubListener=newEventSubWsListener({ apiClient });eventsubListener.start();eventsubListener.onSubscriptionCreateSuccess((subscription)=>{logger.info(`Successfully subscribed to ${subscription.id}`);});eventsubListener.onSubscriptionCreateFailure((subscription,error)=>{logger.error(`Error subscribing to ${subscription.id}:`,error);});eventsubListener.onChannelRedemptionAdd(broadcasterId,()=>console.log('Redemption add event'));eventsubListener.onChannelAdBreakBegin(broadcasterId,()=>console.log('Ad break event'));eventsubListener.onChannelChatMessage(broadcasterId,broadcasterId,()=>console.log('Chat message event'));
Expected behavior
channel.chat.message succeeds whenever the token has user:read:chat despite previous topics failing to subscribe
Actual Behavior
channel.chat.message fails if the token only contains user:read:chat (i.e. when both the previous topics fail to subscribe) (logs below). It does succeed when either the token has all scopes or has user:read:chat plus another of the scopes (i.e. only one previous topic failing).
[2024-03-07T14:34:32.298Z][error] Error subscribing to channel.channel_points_custom_reward_redemption.add.XXXXXXXX: This token does not have any of the requested scopes (channel:read:redemptions, channel:manage:redemptions) and can not be upgraded.
[2024-03-07T14:34:32.314Z][error] Error subscribing to channel.ad_break.begin.XXXXXXXX: This token does not have any of the requested scopes (channel:read:ads) and can not be upgraded.
[2024-03-07T14:34:32.330Z][error] Error subscribing to channel.chat.message.XXXXXXXX.XXXXXXXX: This token does not have any of the requested scopes (channel:read:ads) and can not be upgraded.
Environment
Version: 7.1.0-pre.7
Node version: v20.11
Operating system: Windows 10
The text was updated successfully, but these errors were encountered:
Bug Report
EventSubListener fails to subscribe to topics when it has previously failed more than one (different) subscription due to the token missing proper scopes. Yeah, not the most understandable sentence - let's give some examples, supposing we're trying to subscribe to topics A, B and C, each requiring certain scope:
Code
Using a minimal setup:
Expected behavior
channel.chat.message
succeeds whenever the token hasuser:read:chat
despite previous topics failing to subscribeActual Behavior
channel.chat.message
fails if the token only containsuser:read:chat
(i.e. when both the previous topics fail to subscribe) (logs below). It does succeed when either the token has all scopes or hasuser:read:chat
plus another of the scopes (i.e. only one previous topic failing).Environment
The text was updated successfully, but these errors were encountered: