Repository navigation
fix: decouple wallet restore from profile refresh #1686
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
Open
ben-kaufman
wants to merge
4
commits into
fix/pending-wallet-restore-admission
Choose a base branch
from
fix/restore-identity-background
base: fix/pending-wallet-restore-admission
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+260
−11
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4d86489
fix: decouple wallet restore from profile refresh
ben-kaufman ac2a7c6
docs: associate restore note with PR 1686
ben-kaufman d4ba907
fix: preserve active identity during scheduled restore setup
ben-kaufman 0fd5e42
Merge validated connection recovery into deferred identity restoration
ben-kaufman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Wallet restore finishes without waiting for optional profile refresh, while incomplete identity data cannot replace complete backups. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <journey name="wallet restore during optional identity outage"> | ||
| <description> | ||
| Use a disposable test-network wallet with a complete VSS backup and a saved Pubky identity. | ||
| Required wallet, private reservation and USDT recovery imports must succeed before the injected | ||
| delay starts. Delay only final identity activation or subsequent profile/contact reads. | ||
| Keep metadata credential replacement and required restore imports available. These complete-app | ||
| fault controls are not currently provisioned; component test results are separate evidence. | ||
| Never use live funds or reset an existing wallet. | ||
| </description> | ||
| <actions> | ||
| <action>Restore the complete backup and hold final identity activation; verify ordinary wallet access resumes after required recovery completes, without reporting Paykit authenticated or payment-ready</action> | ||
| <action>Trigger a full backup while the saved identity cannot be exported; verify failure retains the previous complete WALLET record and required pending backup work</action> | ||
| <action>Close the restore screen, release the identity fault and verify retained work completes and a fresh complete backup succeeds once</action> | ||
| <action>Repeat with delayed profile/contact enrichment, then replace or remove the identity; verify late results cannot republish the old identity or overwrite current profile data</action> | ||
| <action>Restart during the outage; verify saved credentials resume recovery without duplicating a payment or contact mutation</action> | ||
| <action>Fail a required wallet or USDT restore instead; verify spending and address allocation remain gated and retry resumes the same required recovery</action> | ||
| </actions> | ||
| </journey> |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOW: after a homeserver outage during restore, the own profile is never reloaded.
With a LocalSeed backup the identity is already active when
scheduleInitializationAfterRestore()runs, so this line skipsinitializeSession()and callsloadIdentityData()straight away. If the homeserver is unreachable at that moment,loadProfile()fails once (Failed to load profile [… fetch profile],:857) and nothing retries it.restoreSessionLocked(:468) andawaitIdentityReady(:426) are the only automatic paths back intoloadIdentityData(), and both return early because_publicKeyis set. The header shows "Your Name" until the user opens Profile or restarts the app. On the merge-base,initialize()drops the identity during the outage, and the session-restore retry later brings it back together with the profile. The missingloadProfileretry is older; this PR makes it reachable.Fix: when an identity is active and no profile is loaded, retry the profile. For example, in
restoreSessionIfNeeded()(it runs on resume, on reconnect and from payment-request maintenance), launchloadProfile(), andloadContacts()if that load failed, when_publicKey.value != null && _profile.value == null. Alternatively, giveloadProfilea bounded backoff retry onisPaykitTemporarilyUnavailable()failures. Unit test: identity active, the firstresolveContactProfilethrowstransport_error, thenrestoreSessionIfNeeded()loads the profile.Reproduction (device, 2 of 2 runs)
Gate_Throwaway emulator, head
0fd5e42. LocalSeed restore with the homeserver blackholed through a local fault proxy right afterFull restore success, then released 10 s after the profile failure.Backup succeeded for: 'WALLET'96 s and 95 s after release).55b31ee, same steps: the name showed 19.6 s after release (Restored paykit sessionat 16:58:03.796).Opening Profile or restarting the app shows the name.