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: prevent app to crash during the unlock phase #6848

Merged
merged 2 commits into from
May 16, 2024
Merged

Conversation

gre
Copy link
Contributor

@gre gre commented May 13, 2024

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • LLD lock screen, unlock with ability to restore accounts
    • the unlock screen will correctly be protected from race condition: once you submit the password, the input password is disabled and the form can't be sent again.

📝 Description

Some users seems to experience an issue with accounts being null, this can be caused when the accounts are encrypted and something fail to decrypt it in time,
this may indicate race condition around https://github.com/LedgerHQ/ledger-live/blob/develop/apps/ledger-live-desktop/src/renderer/components/IsUnlocked.tsx#L44-L55 but at least we contain the error into the management of this code scope instead of a fatal crash that occurs in prod today.

this may reveal another race condition that this PR however don't fix but will help locate it.

Capture d’écran 2024-05-14 à 10 46 48

❓ Context


🧐 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)

@gre gre requested a review from a team as a code owner May 13, 2024 15:03
Copy link

vercel bot commented May 13, 2024

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

5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 8:45am
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 8:45am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 8:45am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 8:45am
web-tools ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 8:45am

@live-github-bot live-github-bot bot added the desktop Has changes in LLD label May 13, 2024
this may reveal another race condition that this PR however don't fix but will help locate it
Copy link
Member

@KVNLS KVNLS left a comment

Choose a reason for hiding this comment

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

I reproduce all the time on develo, with your fix I was never able to reproduce the issue so it works well! Thanks!

@gre gre merged commit e48b5d7 into develop May 16, 2024
34 of 44 checks passed
@gre gre deleted the bugfix/prod-8006 branch May 16, 2024 13:27
mcayuelas-ledger pushed a commit that referenced this pull request May 20, 2024
* fix: prevent app to crash during the unlock phase

this may reveal another race condition that this PR however don't fix but will help locate it

* bug: protect IsUnlocked from race conditions on multiple form submit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop Has changes in LLD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants