Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug or Intender: OpaqueUserId is _not_ UuserID when the broadcaster + extension uses ID Linking #559

Open
BarryCarlyon opened this issue Jan 26, 2022 · 13 comments
Labels
product: extensions ticketed Has been given an internal tracking ticket

Comments

@BarryCarlyon
Copy link
Contributor

Brief description

as per

https://dev.twitch.tv/docs/extensions/reference#jwt-schema

Broadcasters’ tokens are set with "U" + their Twitch user IDs, to avoid confusing opaque IDs with user IDs when the broadcaster is a viewer.

This doesn't seem to be the case

How to reproduce

In an extension that has requestID sharing off

calling window.Twitch.ext.viewer.opaqueId results in U15185913 as expected

In an extension that has requestID sharing enabled and in use

calling window.Twitch.ext.viewer.opaqueId results in Ugibberish not as expected according to the docs.

Expected behavior

Not sure it inteneded or a bug. I'm erring towards bug.

@mgeyer
Copy link

mgeyer commented Feb 7, 2022

Hi Barry, I'm a dev on the extensions team and tried to reproduce this issue, but wasn't able to. Can you provide more details on the steps you took to produce the bug?

The steps I took:

  • Created an extension that ran the following javascript:
window.Twitch.ext.onAuthorized(function(auth) {
    console.log('The Extension JWT is ', auth.token);
    console.log('The user opaque id is ', window.Twitch.ext.viewer.opaqueId);
});
  • Set Request Identity Link to No, I would not like my extension to request an identity link.
  • Put extension into hosted test.
  • Install the extension on my own channel
  • Load the channel (logged in as the same user as the channel I installed the extension on)
  • Check console and see U123456789
  • Take extension out of hosted test
  • Set Request Identity Link to Yes, I would like my extension to request an identity link.
  • Move extension back to hosted test.
  • Make sure that my account is disconnected from the extension in https://www.twitch.tv/settings/connections
  • Refresh my channel (still logged in as my user)
  • Check console and see U123456789

@BarryCarlyon
Copy link
Contributor Author

image

@BarryCarlyon
Copy link
Contributor Author

TLDR: exactly what you did.

@mgeyer
Copy link

mgeyer commented Feb 7, 2022

Hmm that is strange. Ok so let me ask some questions (apologies for some that may seem obvious)

  • The user you're logged in as is the same as the channel?
  • Does the opaque ID in your extension JWT match the userID in the console?
  • Have you tried installing the extension as a component and does it produce the same results?

@BarryCarlyon
Copy link
Contributor Author

The user you're logged in as is the same as the channel?

Yes hence "Edit Panels" and no visible dude icon in the Footer bar

Does the opaque ID in your extension JWT match the userID in the console?

Yes

image

Have you tried installing the extension as a component and does it produce the same results?

No. I would have to go live.

@BarryCarlyon
Copy link
Contributor Author

It also does it in the config view

image

the test code https://github.com/barrycarlyon/twitch_extension_debug

It's in "local test" where the Testing base URI is the GitHub pages for this code

@mgeyer
Copy link

mgeyer commented Feb 7, 2022

I've tried my own extension in both panel and config view and still see the correct userID. I get the same results if I'm on a different user as well. It could be something specific to your user. Can you try on a different account and see if the issue persists?

@BarryCarlyon
Copy link
Contributor Author

I'll have a poke about further when I get a moment

@mgeyer
Copy link

mgeyer commented Feb 14, 2022

Hey Barry, just wanted to check in again to see if you've had time to look at the issue.

@BarryCarlyon
Copy link
Contributor Author

Here you go @mgeyer sorry for the delay:

As a componenet

image

And as an overlay

image

Both return an "incorrect" opaque user ID

@mgeyer
Copy link

mgeyer commented Mar 2, 2022

Thanks for the followup! Could you try to go to https://www.twitch.tv/settings/connections and see whether you have your extension in the list of Extension Connections? If so could you try to unlink and then refresh the page?

@BarryCarlyon
Copy link
Contributor Author

BarryCarlyon commented Mar 3, 2022

That fixes the problem.

However, I tested a live extension to see the following

Extension: The Cohhilition
This extension is installed on CohhCarnage's channel
I am requestID shared on cohh's channel to the extension
If I install that same extension to my channel
Then view the extension as "the broadcaster" as it's on my channel

So I get the same opaque ID across Twitch.
But on my own channel the opaqueID is not overriden to UMYID.

Which is a problem as it deviates from the documentation, espeically in cases where some developers will hard code or construtct the opaqueID

@jbulava
Copy link
Member

jbulava commented Mar 3, 2022

@mgeyer created a ticket for this on ANC-2991.

@jbulava jbulava added the ticketed Has been given an internal tracking ticket label Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: extensions ticketed Has been given an internal tracking ticket
Projects
None yet
Development

No branches or pull requests

3 participants