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

Ledger Sync - Display error when scanning invalid QR Code #7800

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

cgrellard-ledger
Copy link
Contributor

@cgrellard-ledger cgrellard-ledger commented Sep 12, 2024

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:

πŸ“ Description

Replace this text by a clear and concise description of what this pull request is about and why it is needed. Be sure to explain the problem you're addressing and the solution you're proposing.
For libraries, you can add a code sample of how to use it.
For bugfixes, you can explain the previous behavior and how it was fixed.
In case of visual features, please attach screenshots or video recordings to demonstrate the changes.

Description Behavior
Scans a Ledger Sync QR code on desktop with FF disabled on mobile Screenshot_2024-09-11-17-52-10-82_99c1b3bb631177f8a9e1379ae5b12ffe
Scans the old QR code on desktop with FF enabled on mobile Screenshot_2024-09-11-18-05-16-58_99c1b3bb631177f8a9e1379ae5b12ffe
Scans a QR code that has nothing to do with Ledger Sync when FF enabled on mobile Screenshot_2024-09-11-18-05-35-27_99c1b3bb631177f8a9e1379ae5b12ffe

❓ Context

  • JIRA or GitHub link: LIVE-14059 [LIVE-14064] [LIVE-14020]

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@cgrellard-ledger cgrellard-ledger requested a review from a team as a code owner September 12, 2024 08:27
Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
web-tools ❌ Failed (Inspect) Sep 12, 2024 2:01pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Sep 12, 2024 2:01pm
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Sep 12, 2024 2:01pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Sep 12, 2024 2:01pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Sep 12, 2024 2:01pm

Copy link
Contributor

@mcayuelas-ledger mcayuelas-ledger Sep 12, 2024

Choose a reason for hiding this comment

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

You need to add it also in apps/ledger-live-mobile/src/newArch/features/Accounts/screens/AddAccount/components/StepFlow.tsx

Comment on lines +80 to +86
if (data.match(/host=([0-9A-Fa-f]+)/)) {
this.setState({
error: new ScannedNewImportQrCode(),
progress: 0,
});
screen("", AnalyticsPage.ScannedIncompatibleApps, { source: "Account Import Sync" });
}
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 have to do it in the catch block? Couldn't we perform the check at the beginning instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the analytics event for the error that is triggered in the catch (the setState({ error: new ScannedNewImportQrCode() }) ).
As it's handled by the generic error component I had to trigger the analytics here

Copy link
Contributor

@mcayuelas-ledger mcayuelas-ledger left a comment

Choose a reason for hiding this comment

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

StepFlow.tsx needs to be updated also

@cgrellard-ledger cgrellard-ledger merged commit 52ae4d3 into develop Sep 13, 2024
48 of 50 checks passed
@cgrellard-ledger cgrellard-ledger deleted the bugfix/ledger-sync-scan-invalid-qr-code branch September 13, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Has changes in LLM translations Translation files have been touched
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants