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: stop beignet wallet before replace/wipe it #2385

Merged
merged 1 commit into from
Dec 9, 2024
Merged

fix: stop beignet wallet before replace/wipe it #2385

merged 1 commit into from
Dec 9, 2024

Conversation

limpbrains
Copy link
Collaborator

Description

This should prevent wallet instance to write any data to the redux or call any onMessage callback after it has been stoped.
Maybe we can stop restarting RN after this

Linked Issues/Tasks

Type of change

Bug fix

Tests

No test

Copy link

socket-security bot commented Dec 4, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] network 0 9.39 MB limpbrains

🚮 Removed packages: npm/[email protected]

View full report↗︎

@limpbrains limpbrains marked this pull request as ready for review December 9, 2024 16:21
@limpbrains limpbrains requested a review from pwltr December 9, 2024 16:21
Comment on lines +34 to +39
// stop onchain wallet if it exists
try {
const wallet = getOnChainWallet();
await wallet.stop();
} catch (e) {}

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can expect the wallet to exist at this point, so it should be able to be stopped. If it does fail we should probably propagate and return the error. Especially if we're going to remove the restart in the future.

Suggested change
// stop onchain wallet if it exists
try {
const wallet = getOnChainWallet();
await wallet.stop();
} catch (e) {}
// stop onchain wallet if it exists
const wallet = getOnChainWallet();
await wallet.stop();

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We run wipeApp during Onboard/TermsOfUse, at this point wallet does not exists

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right ok let's leave it for now. If we're going to remove the restart later we should probably return the error outside the onboarding though.

@limpbrains limpbrains merged commit 32bbd32 into master Dec 9, 2024
7 checks passed
@limpbrains limpbrains deleted the stop branch December 9, 2024 17:06
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.

2 participants