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: email update #2158

Merged
merged 10 commits into from
Apr 19, 2024
Merged

fix: email update #2158

merged 10 commits into from
Apr 19, 2024

Conversation

ignaciosantise
Copy link
Collaborator

@ignaciosantise ignaciosantise commented Apr 15, 2024

Changes

  • fix: use updateEmail response to decide whether to redirect to first or second OTP screen

Steps to reproduce issue in production:

  1. Create a NEW email account using an unused email
  2. After connecting, change your email to a new one fast
  3. Magic will send an OTP code directly to the new email and not to the current one
  4. This causes the view to hang waiting for UPDATE_EMAIL_SUCCESS event

Associated Issues

https://linear.app/walletconnect/issue/W3M-171/%5Bbug%5D-freeze-update-email-flow-when-otp-is-sent-to-new-email-only

Related

Secure site PR 120

Copy link

vercel bot commented Apr 15, 2024

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

Name Status Preview Comments Updated (UTC)
web3modal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 1:33pm
web3modal-gallery ✅ Ready (Inspect) Visit Preview Apr 19, 2024 1:33pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Apr 19, 2024 1:33pm

@ignaciosantise ignaciosantise changed the title Fix/email update fix: email update Apr 15, 2024
Copy link
Collaborator

@tomiir tomiir left a comment

Choose a reason for hiding this comment

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

This looks OK, just wondering if zod will break when secure site starts returning new data and old versions can't handle it.

Did you try new secure site with older versions of w3m?

@ignaciosantise
Copy link
Collaborator Author

ignaciosantise commented Apr 17, 2024

@tomiir yes, i tested the new secure site with an old version of w3m and it doesn't break because zod.parse removes the extra data. But i'll test everything again to be 100% sure.

Log using old w3m and new secure-site -> zod filters the new payload in UPDATE_EMAIL_SUCCESS

  • The first log is before frameEvent.parse and show the new secure site payload
  • the second log is what the provider receives in the event data
Screenshot 2024-04-17 at 10 42 27 AM

@ignaciosantise
Copy link
Collaborator Author

@arein @lukaisailovic added update email tests

apps/laboratory/tests/shared/pages/ModalPage.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@lukaisailovic lukaisailovic left a comment

Choose a reason for hiding this comment

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

New change has been merged in V4 that uses random emails for each tests. Refer to that and update so we use that approach for this test as well

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