GET request url is broken when allowed test user attempts to use panel extension running in Hosted Test mode



I am currently running my panel extension in the devevloper Hosted Test mode.

Inside the developer twitch console > Access tab I have added under Testing Account Allowlist my test user.

Current Results:

The config page I designed has a simple save button that performs an XHR GET request to my external api. For example

When the config page runs via the developer account (the user who is running the hosted test). I am able to get a 200 OK response. Everything works great.

Now lets assume my allowed test user visits my Twitch channel running the test panel extension…
The test user taps Ok to the test extension disclaimer and they are able to see the extension fine. This is also working great.

Now lets assume the test user attempts to install the extension. This also seems to work.

However, when the same config page runs via the test account and the user taps the same Save button and the XHR GET request fires, the request URL is totally different and failing with a 404.

For some reason the XHR GET request is now showing…

It should be the same as before:

Long story short…

Why is the request url being changed to this invalid URL.

Expected Results:
The XHR GET request should behave the same for both the developer hosting the extension and also the allowed test user who wishes to install and test this extension that is running in the development hosted test mode.

Does the XHR GET request fail simply because the extension is not yet made live on Twitch and therefore the request url in the GET request is broken? If so, that would mean that test users can only fully test once the extension is made live?

Any advice much appreciated!

Thank you!

The problem is in your code somewhere.

The state of the extension is irrelevant to your config page attempting to call your EBS.

So this suggests a fault in your code somewhere.
As this suggests that the code is doing something different between whom is acessing the config page.

I will have to review further. Thx for the feedback

if I was going “left field”

It sounds like the URL to your EBS is stored in the Config Service.
But you stored it in a channel segment
And it’s unpopulated for the test user.
So it tried to call null/v1 which got appended to the page URL

You may be on to something.

When the page loads I have the twitch.configuration.onChanged() firing… Inside there I have it running inside a try/catch to parse from the twitch.configuration.broadcaster.content JSON string, containing my settings…

I think that what is happening is that its probably not able to access the broadcaster content and somehow I’m not setting the local state of the app to configure my request url that is used for the XHR GET request.

I will dbl check this.

Each broadcaster segment is local to the user.
So if you never set it, then it’ll trip.

But at least we have an idea now.

Yeah I am aligned with you on the “Each broadcaster segment is local to the user”

So probably its tripping into the catch block … and this is where I need to add the condition to setup my request urls… I will try that.

@BarryCarlyon thanks again, its fixed. I needed to make a method call to set stuff up in the catch block when the user has not yet ever configured the configuration service , since no data yet existed (the json parse failure was triggering it)


1 Like