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: social login popup blocked by safari #3878

Merged
merged 9 commits into from
Feb 19, 2025
Merged

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Feb 19, 2025

Description

We have an asynchronous function which takes time to load up the popup window which then causes browsers like safari to block our popup window.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-2306

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Feb 19, 2025

Copy link

changeset-bot bot commented Feb 19, 2025

🦋 Changeset detected

Latest commit: 79596e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@reown/appkit-scaffold-ui Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-demo 🛑 Canceled (Inspect) Feb 19, 2025 0:17am
appkit-ethers5-bera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 0:17am
appkit-laboratory 🛑 Canceled (Inspect) 💬 Add feedback Feb 19, 2025 0:17am
next-wagmi-solana-bitcoin-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 0:17am
9 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Feb 19, 2025 0:17am
appkit-basic-ep-example ⬜️ Ignored (Inspect) Feb 19, 2025 0:17am
appkit-basic-example ⬜️ Ignored (Inspect) Feb 19, 2025 0:17am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Feb 19, 2025 0:17am
appkit-basic-up-example ⬜️ Ignored (Inspect) Feb 19, 2025 0:17am
appkit-vue-solana ⬜️ Ignored (Inspect) Feb 19, 2025 0:17am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Feb 19, 2025 0:17am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Feb 19, 2025 0:17am
vue-wagmi-example ⬜️ Ignored (Inspect) Feb 19, 2025 0:17am

Copy link
Contributor

github-actions bot commented Feb 19, 2025

Warnings
⚠️ File packages/scaffold-ui/src/partials/w3m-social-login-widget/index.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against 79596e8

Copy link
Contributor

github-actions bot commented Feb 19, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 72.21% 23007 / 31859
🔵 Statements 72.21% 23007 / 31859
🔵 Functions 62.16% 1847 / 2971
🔵 Branches 80.93% 3957 / 4889
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/scaffold-ui/src/partials/w3m-social-login-widget/index.ts 57.59% 56.66% 77.77% 57.59% 55-56, 77, 86-89, 92-93, 106, 110, 112, 124, 133-134, 137-138, 145-181, 186-187, 199-206, 218-232, 251-252, 259-261, 268-273, 276-278
Generated in workflow #9694 for commit 79596e8 by the Vitest Coverage Report Action

Comment on lines 37 to 39
vi.spyOn(AccountController, 'setSocialProvider')
vi.spyOn(EventsController, 'sendEvent')
vi.spyOn(RouterController, 'push')
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to spyOn these if we don't check them if they are called or not?

Comment on lines 240 to 251
this.popupWindow = CoreHelperUtil.returnOpenHref(
'',
'popupWindow',
'width=600,height=800,scrollbars=yes'
)

if (this.popupWindow) {
AccountController.setSocialWindow(this.popupWindow, ChainController.state.activeChain)
} else {
throw new Error('Something went wrong')
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

does this impact TG integration @ganchoradkov ?

Copy link
Member

Choose a reason for hiding this comment

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

most likely yes, this.popupWindow is undefined in telegram context so the logic will not continue with this throw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a change

@@ -237,34 +237,38 @@ export class W3mSocialLoginWidget extends LitElement {

try {
if (authConnector && socialProvider) {
this.popupWindow = CoreHelperUtil.returnOpenHref(
Copy link
Contributor

Choose a reason for hiding this comment

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

We open new window here and also opening new window in (CoreHelperUtil.isTelegram()) {...}. Not sure if this breaks stuff in telegram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants