Skip to content

Conversation

@SajeeTechi
Copy link
Contributor

No description provided.

…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
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)
@SajeeTechi SajeeTechi requested a review from kevtechi January 6, 2026 09:59
@SajeeTechi SajeeTechi self-assigned this Jan 6, 2026
@SajeeTechi SajeeTechi merged commit 45460d5 into release/2.0.31 Jan 6, 2026
1 check failed
@SajeeTechi SajeeTechi deleted the feat/account-factory-selection branch January 8, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant