Closed tballmsft closed 1 year ago
This happened to me yesterday. A refresh fixed it, but I'm not sure what happened.
This is likely fixed in the new deployment. Will test once it makes it out to prod.
Side issue: we need to remove use of window.alert here.
When the kiosk is getting the pre-populated games for the kiosk, there is a fetch request and this is likely where we're getting the error. It's hard for me to fully understand why, so I'll stay on the look out for this issue and look into the logs. It's happened to me before, too, but I didn't think to look at the logs then and I haven't been able to repro it, unfortunately.
I was able to get a repro and the errors!
Looks like there's an open issue for browsers to safelist this header in the context of CORS: https://github.com/whatwg/fetch/issues/911
Retry logic might be the best solution here. Seems like the browser doesn't always send this header, since it works on page refresh. :shrug:
I know that page refresh will get the kiosk back in a working state, but this makes me think there's a better way we can approach this. Other arcade applications don't have a problem with fetching assets, so if we can consolidate without retries, I think that would be my preferred path forward.
I guess I'm just curious why this is a problem for kiosk. If, with fully moving this over now, we can more mirror what happens with our other web apps, that would be nicer at least.
Agreed. It would be good to know why this is happening in kiosk and not to similar apps like skillmap and multiplayer. There is something peculiar going on here we're not seeing elsewhere.
The CORS check itself seems entirely unnecessary in this case. It's hitting CDN, all requests to it are cross origin.
I now cannot get this to repro very easily. I've restarted my computer many times to try to get the error but I only got it once this morning. The failure I got was not the same, either. I got a network error instead of the CORS error. Not sure how to proceed here.
From what I've gathered and chatted with Eric about, including traceparent
and tracestate
to our allowed headers will be the best route forward for the CORS error that I saw, but if the CORS error isn't the real error to look out for, then I wouldn't want to make that change.
Actually this request isn't hitting our backend so modifying CORS handling isn't an option here.
I can get a 90% repro in Firefox if I hit refresh a bunch. Here's what I see in the sent headers:
I highlighted the problematic headers. It doesn't always send them. Here's the error response:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://pxt.azureedge.net/blob/9e5e9051f8f72796b42a1e3320fad605192cdbd1//kiosk-data/GameList.json. (Reason: header ‘request-id’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response).
Retry logic is probably the way to go here.
Oh, I'm glad(ish) to see that you got a network error as well. Okay, I'll go with retry logic.
Still seeing this occasionally. Just a thought: I wonder if a small delay before the second fetch attempt would help.
Yeah, I can do that. When you see this, are you still getting the same errors?
I can replicate consistently on Safari by holding shift+reload
If you reload again will you get the error? I'm worried that just trying to delay the retry a bit won't really solve the problem.
Still happening in my logged-in window. Not happening at all in a private window.
I believe this is fixed now. Please reopen if you see it.
still happening :/
Should be fixed now. Please reopen if you see it again.