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

🪟 🐛 Fix issue with opener window closed #22107

Merged
merged 2 commits into from
Jan 31, 2023
Merged

Conversation

timroes
Copy link
Collaborator

@timroes timroes commented Jan 30, 2023

What

This fixes a weird edge-casey issue (that I've seen some users run into), when starting an OAuth flow for a connector and then closing the original Airbyte tab, but keep the OAuth flow popup open and finish it. Currently it will bring you back to the webapp after the flow, and we'll try to call window.opener.postMessage, but window.opener (the original tab) is now closed so we'll crash the popup window also with a "Ooops something went wrong" screen.

Changing this, so in case the original tab was closed and you still finish the OAuth flow, we'll just close this, and basically ignore it, since the user aborted setting up the connector by closing that tab.

@timroes timroes added area/frontend Related to the Airbyte webapp ui/connectors labels Jan 30, 2023
Copy link
Contributor

@lmossman lmossman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM, tested locally and it works as expected.

Though, I think it would be ideal if closing the original Airbyte tab would just cause the OAuth popup to automatically close as well. Is that approach also simple to achieve (I assume not)? If so I would vote to go with that behavior; if not then I think what we have here is fine too.

@timroes
Copy link
Collaborator Author

timroes commented Jan 31, 2023

@lmossman I agree this is indeed better. I added this to the PR as well. I'd still leave the other code for safty reasons, to not crash in case that still happens (since closing event handler can be a bit tricky and potentially not called by the browser).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants