-
Notifications
You must be signed in to change notification settings - Fork 8
Feat/account factory selection #275
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
Conversation
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
…addresses - Migrates legacy secure storage keys from `address@alias` to the new `address@factory@alias` format. - Uses `getAccountFactoryAddressByAlias` to backfill factory addresses during migration. - Employs `BackupWalletV5` to ensure consistent EIP-55 address formatting. - Safely deletes old credential keys after successful migration.
…ey-with-account-factory Feat/apple android saved key with account factory
- Update AccountsServiceInterface to use DBAccountV4 for account retrieval. - Migrate Android, Apple, and Web account service implementations to DBAccountV4. - Update AccountsTable.all() to fetch and map records using DBAccountV4.fromMap. - Ensure type consistency across account backup services following the v4 database migration.
refactor(accounts): update getAllAccounts to return DBAccountV4
- not needed. combination of address@alias is unique
…yAddress Migrates credential storage from address@alias format to address@accountFactoryAddress@alias format using BackupWalletV5. Updates all credential read/write operations in Android and Apple account services to use the new composite key structure. - Add migration version 5 for both platforms - Update getAllAccounts, setAccount, getAccount, deleteAccount methods - Migrate existing credentials automatically on app upgrade - Ensures accountFactoryAddress is part of credential identification
- get account abs config - get rpc url
- considering bad migration versions of branch release/2.0.30...release/2.0.26
…ounts Using acc factory with accounts
Implements a robust version 5 migration for the accounts table to handle different upgrade paths and fix data corruption caused by a previous migration. Key changes: - Robust Column Addition: Replaces the direct 'ALTER TABLE' with `AddAccountFactoryAddressIfNotExists`. This uses a PRAGMA check to prevent crashes on builds where the column might already exist (e.g., AppKevin path). - ID Cleanup Logic: Introduces `CleanDirtyV4Accounts` to identify and fix accounts using the "bad" ID format (`address@factory@alias`). It reverts these IDs back to the standard format (`address@alias`). - Conflict Handling: During cleanup, ensures that if a correct ID already exists, the dirty duplicate is removed without overwriting existing valid data. - Migration Orchestration: Updates the version 5 migration map to execute these steps in the correct order: verify column -> populate data -> clean IDs.
Updates the `_cleanDirtyV4Accounts` migration logic to handle and repair accounts that do not match either the standard format or the known "bad" V4 format. Key changes: - Active Correction: Replaces the warning log for "unexpected formats" with an active migration to the standard `oldFormatId`. - Integrity Protection: Before migrating an unexpected ID, the code checks for existing standard format IDs to prevent primary key conflicts. - Data Preservation: If no conflict exists, it creates a corrected record with the standard ID while preserving all associated account data. - Cleanup: Automatically deletes the record with the malformed/unexpected ID after the migration or conflict check is complete.
… formats Implements a unified migration strategy (v7) for both iOS and Android platforms to handle two divergent migration histories: - AppKevin users (v6->v7): Had bad migrations in v5-v6 that created credentials with incorrect accountFactoryAddress values in the key format. Migration #7 detects and cleans these dirty keys by reconstructing them with the correct accountFactoryAddress from getAccountFactoryAddressByAlias(). - AppOthers users (v4->v7): Skip empty migrations v5-v6 and migrate directly from old format (address@alias) to new format (address@accountFactoryAddress@alias) using the correct accountFactoryAddress. Changes: - Refactored key detection to categorize credentials into oldFormatKeys (2 parts) and dirtyNewFormatKeys (3 parts) for targeted handling - Added AppKevin path: validates existing 3-part keys and recreates them with correct accountFactoryAddress if needed (case-insensitive comparison) - Enhanced AppOthers path: migrates 2-part keys to 3-part format with proper accountFactoryAddress lookup - Enabled deletion of old/dirty keys (removed TODO comments) - Added comprehensive debug logging for migration tracking - Implemented idempotent logic: keys already in correct format are skipped Both user groups converge to the same final state at version 7 with credentials in format: address@accountFactoryAddress@alias where accountFactoryAddress is correctly determined by community alias. Platforms: iOS (apple.dart), Android (android.dart)
Fix/acc factory bad migration
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.
No description provided.