-
Notifications
You must be signed in to change notification settings - Fork 251
fix(auth,migration): sanitize legacy wallet name and preserve legacy flag during migration #3207
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e1387ac
fix(auth,migration): preserve legacy flag and sanitize wallet name du…
CharlVS 3e79612
chore(deps): update sdk submodule and pubspec lock references\n\n- Al…
CharlVS b0666e2
chore(submodule): align sdk to origin/dev referenced commit 36556dd
CharlVS dc47c01
chore(ci): add PR_BODY.md helper file for CLI editing
CharlVS ee69228
fix(migration): only sanitize names for legacy wallets; keep non-lega…
CharlVS 578c7f5
fix(migration): attempt sign-in with sanitized base name before resol…
CharlVS 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| Summary | ||
|
|
||
| - Preserve `WalletConfig.isLegacyWallet` in `copy()` so legacy wallets route to `AuthRestoreRequested`. | ||
| - Sanitize legacy wallet names: replace non-alphanumeric (Unicode letters/digits) except "_" with "_". | ||
| - Resolve collisions by appending the lowest integer suffix (e.g., name, name_1, name_2, ...). | ||
| - Apply during legacy migration in `AuthBloc._onRestore`; delete legacy entry after success. | ||
|
|
||
| Why | ||
|
|
||
| Fixes a critical bug where some users can't log into wallets created with old versions and the wallet disappears. | ||
|
|
||
| Testing | ||
|
|
||
| - Create a legacy wallet with special characters and attempt login; verify migration uses sanitized unique name and signs in. | ||
| - Verify if a non-legacy wallet already has the sanitized name, the migrated wallet uses the lowest available _N suffix. | ||
|
|
||
| Notes | ||
|
|
||
| No API changes. Static analysis passes for changed files. |
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
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.
Bug: Incorrect Wallet Name Logged During Deletion
When deleting a legacy wallet, the log message shows
workingWallet.name(the sanitized name), but thedeleteWalletcall removesevent.wallet(the original legacy wallet). This logs the incorrect wallet name for the item being deleted.