fix: mnemonic not found crash#678
Merged
Merged
Conversation
ovitrif
previously approved these changes
Jan 20, 2026
ovitrif
left a comment
Collaborator
There was a problem hiding this comment.
utAck
PS. Still need to resolve the nit review comments to be able to merge AFAIU, so I let myself choose Approve even though I want the remarks addressed 🙏🏻
This comment has been minimized.
This comment has been minimized.
Collaborator
|
@piotr-iohk to streamline this |
- Remove unused assertTrue import from VssBackupClientTest - Remove doc comments and inline comments from VssBackupClient - Refactor setup() to return Result<Boolean> - Add DSL-style setupWithRetry() with SetupRetryLogger builder - Move retry logic from BackupRepo to VssBackupClient - Update tests for Result<Boolean> return type Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2 tasks
…view fix: address PR review comments for mnemonic crash fix
This comment was marked as resolved.
This comment was marked as resolved.
jvsena42
reviewed
Jan 21, 2026
jvsena42
reviewed
Jan 21, 2026
jvsena42
reviewed
Jan 21, 2026
jvsena42
previously approved these changes
Jan 21, 2026
jvsena42
left a comment
Member
There was a problem hiding this comment.
Just left two suggestion that can be solved here or in other PR
Collaborator
Addressing here 🙏🏻 |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment was marked as resolved.
This comment was marked as resolved.
jvsena42
approved these changes
Jan 21, 2026
jvsena42
left a comment
Member
There was a problem hiding this comment.
Tested:
- Lightning channels
- Install over RN
- recover from RN
- Reset and restore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #553
Fixes: #691
OBS: #657 (comment)
Description
This PR fixes a crash that occurs when
VssBackupClient.setup()is called before the mnemonic is available in the keychain. This race condition can happen during wallet restoration whenBackupRepo.startObservingBackups()is triggered (onNodeLifecycleState.Running) before the mnemonic has been saved.Root cause:
Changes:
VssBackupClient.setup()now returnsBoolean(true = success, false = mnemonic not available yet)BackupReponow retriessetup()with linear backoff (1s, 2s, 3s... up to 10 attempts) when mnemonic is not yet availablePreview
N/A - crash fix, no UI changes
QA Notes
To reproduce the original crash: note: it is intermittent.
Unit tests added:
setup returns false when mnemonic is not availablesetup does not call vssStoreIdProvider when mnemonic is not availablesetup checks mnemonic before proceeding with vss initializationsetup can be called multiple times when mnemonic not availableRun with:
./gradlew testDevDebugUnitTest --tests "to.bitkit.data.backup.VssBackupClientTest"