Open S0c5 opened 2 years ago
Is this a duplicate of #2295 or a different issue?
Looks like the same. I wonder if WebSockets could be the answer indeed?
- lost of context for
window.opener
what does this actually mean in technical terms? what is a context
?
I'm not sure why WebSockets is a "magical solution".
It's also a bit hard to grasp for me what the up and downsides of using websockets for this particular case are.
We noticed this issue as well, but also on a Mac (both Chrome and Safari). Not sure if it's related, but it seems close. Sign in, get redirected to a blank page, and this shows up in the console as an error:
Uncaught TypeError: Cannot read properties of null (reading 'postMessage')
at send-token?uppyAuthToken=...
Is there any updates on a fix or #4110 @mifi ? I've noticed this issue on Android for a while, but now that it potentially affects some users on Desktop, this is more of a concern to me. I should note some of our users get this, some don't. It's unclear why, and I also seem to be getting the same error on the Uppy home page when connecting my Instagram account.
If it can be reproduced somehow on desktop, that would make it easier to look into a fix
I've done some testing locally, and couldn't come up with a fix, but I think I got much closer. It seems the likely culprit is window.opener.postMessage
not having any context. In the browser, it complains that postMessage
is null, which really it's because opener
is null. For some reason the context is being lost (in some cases) and opener
is null. I tried modifying things on the server side such as waiting for window.onload
and then executing the window.opener.postMessage
but to no avail. It might be client side where window.open()
is called to redirect to Instagram that needs a bit more help. My best guess right now is that maybe for some Instagram accounts there is a few more redirects and it messes with opener context, but I'm not sure. Hopefully this sheds a bit more light at least and moves us closer to a fix. As suggested originally, webSockets may be the best solution here
Initial checklist
Link to runnable example
No response
Steps to reproduce
how to reproduce?
Instgram app installed
What is causing the error:
window.opener
when user is redirected through app to the authorization page.Work around?
Expected behavior
That I coud connect with instagram
Actual behavior
blank page at instagram/send-token/