fix(rs-platform-wallet): fail-closed on registration persist error (Found-017) [backport]#3659
Draft
lklimek wants to merge 1 commit into
Draft
fix(rs-platform-wallet): fail-closed on registration persist error (Found-017) [backport]#3659lklimek wants to merge 1 commit into
lklimek wants to merge 1 commit into
Conversation
…ound-017) [backport] Semantic backport of the #3549-proven Found-017 fail-closed fix. Region diverged on v3.1-dev so the change was re-applied by hand. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6 tasks
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.
Semantic backport to v3.1-dev of the #3549-proven Found-017 fail-closed fix.
Root cause:
register_walletlogged the registrationpersister.store(...)Errand fell through, then committed in-memory state and returnedOk. The wallet worked for the session but was silently lost on restart — write-acknowledged-but-not-durable.Fix: on the registration
store()Err, keep thetracing::error!, re-acquire the wallet-manager write guard,remove_wallet(&wallet_id)to roll back the in-memoryinsert_wallet, and returnErr(WalletCreation(...)). Fail-closed, mirroring the same function's existingload_persisted/initialize_from_persistedrollback idiom. Reuses the existingWalletCreationvariant — no new variant, no error-type churn.The v3.1-dev region diverged ~62 lines from origin/feat so a textual cherry-pick would not apply; re-applied by hand as a semantic transform. Single
remove_walletfully unwinds — onlyinsert_walletis committed at thestore()point (self.wallets.insertis downstream).Validation: correctness already proven on #3549 (deterministic network-free pin + positive guard, QA-PASS). v3.1-dev has no found_017 e2e pin by design; here:
cargo check --testsclean,clippy --lib -D warningsclean,cargo test --lib121 passed / 0 failed, rustfmt clean. Pin coverage stays #3549-only.Sibling PR to #3549.
🤖 Generated with Claude Code