Conversation
…ring migration\n\n- Keep WalletConfig.isLegacyWallet in copy() to ensure legacy flow\n- Sanitize legacy wallet names (non-alnum except _) and ensure uniqueness\n- Use sanitized, unique name in restore flow; delete legacy after success\n\nCloses: #none
…ign submodules and pubspec to latest workspace state\n- No app code changes
…ving uniqueness\n\nPrevents duplicate wallets by avoiding premature suffixing during legacy migration.
…ion-sanitize-unique fix(auth,migration): sanitize legacy wallet name and preserve legacy flag during migration
|
Caution Review failedThe pull request is closed. WalkthroughThe pull request implements legacy wallet migration with automatic name sanitization and collision resolution. Changes include preserving the isLegacyWallet flag during config copying, adding utility methods for name sanitization and uniqueness resolution, and refactoring the restoration flow to handle legacy wallets with potentially updated names before sign-in attempts. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AuthBloc
participant WalletsRepo
participant SignIn
participant Wallet
User->>AuthBloc: Restore event with legacy wallet
AuthBloc->>WalletsRepo: sanitizeLegacyMigrationName(name)
WalletsRepo-->>AuthBloc: sanitized_name
AuthBloc->>SignIn: Attempt sign-in with sanitized_name
alt Sign-in succeeds
SignIn-->>AuthBloc: Success
AuthBloc->>Wallet: Delete legacy entry
AuthBloc-->>User: Restoration complete
else Sign-in fails (collision)
SignIn-->>AuthBloc: Failure
AuthBloc->>WalletsRepo: resolveUniqueWalletName(sanitized_name)
WalletsRepo-->>AuthBloc: unique_name (e.g., sanitized_name_1)
rect rgb(200, 220, 240)
note over AuthBloc: Resume with unique name
AuthBloc->>AuthBloc: Update workingWallet name
end
AuthBloc->>SignIn: Sign-in with unique_name
SignIn-->>AuthBloc: Success
AuthBloc->>Wallet: Delete legacy entry
AuthBloc-->>User: Restoration complete
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes The changes span multiple interconnected components with heterogeneous logic patterns: dense conditional flow in auth_bloc.dart for legacy restoration, new utility methods with edge-case handling in wallets_repository.dart, and subtle flag-preservation logic in wallet.dart. The restoration pipeline requires careful tracing through sign-in attempts, name resolution, and cleanup sequencing, along with verification that workingWallet consistently replaces the original wallet reference throughout. Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
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 |
|
Visit the preview URL for this PR (updated for commit ee0b25b): https://walletrc--pull-3208-merge-3fffbnbw.web.app (expires Wed, 29 Oct 2025 15:55:47 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
Summary by CodeRabbit
Release Notes
New Features
Chores