- Remove conditional notification logic in NewActivityView
- Remove redundant notification in RecentOffersToUserView and RecentOffersToUserProjectsView
- Standardize to single notification message format
- iOS, Android, and Electron build scripts now load .env.development, .env.test, .env.production files
- Previously only loaded generic .env file which doesn't exist
- Ensures consistent image server URL across all build targets
- Fixes issue where build:ios:dev used production image URL instead of test URL
- Aligns with web build script behavior for environment variable precedence
Resolves inconsistent VITE_DEFAULT_IMAGE_API_SERVER values between build targets.
- Fix 't is not a function' error during image upload by properly initializing notification helpers
- Move notification helper initialization from class-level to lifecycle methods (created/mounted)
- Affected components: ImageMethodDialog, SeedBackupView, QuickActionBvcBeginView, HelpNotificationsView
- Ensures $notify is available when createNotifyHelpers() is called
- Resolves notification errors in image upload functionality
- Delete active-identity-upgrade-plan.md (390 lines)
- Delete active-pointer-smart-deletion-pattern.md (392 lines)
- Delete activeDid-migration-plan.md (559 lines)
- Delete migration-004-complexity-resolution-plan.md (198 lines)
- Delete verification-party-system-plan.md (375 lines)
These documents were created during migration development phases
and are no longer needed after successful implementation. Removing
them reduces repository clutter and eliminates outdated information.
Total cleanup: 1,914 lines of obsolete documentation removed.
- Remove isDevelopment environment checks and migrationLog variable
- Replace conditional logging with consistent logger.debug() calls
- Remove development-only validation restrictions
- Maintain all error handling and warning messages
- Let existing logger handle development mode behavior automatically
This simplifies the migration service logging while preserving all
functionality. The existing logger already handles development vs
production mode appropriately.
- Remove explicit transaction wrapping in migration service that caused
"cannot start a transaction within a transaction" errors
- Fix executeSet method call format to include both statement and values
properties as required by Capacitor SQLite plugin
- Update CapacitorPlatformService to properly handle multi-statement SQL
using executeSet for migration SQL blocks
- Ensure migration 004 (active_identity_management) executes atomically
without nested transaction conflicts
- Remove unnecessary try/catch wrapper
Fixes iOS simulator migration failures where:
- Migration 004 would fail with transaction errors
- executeSet would fail with "Must provide a set as Array of {statement,values}"
- Database initialization would fail after migration errors
Tested on iOS simulator with successful migration completion and
active_identity table creation with proper data migration.
- Single SQL source: Define MIG_004_SQL constant to eliminate duplicate SQL definitions
- Atomic execution: Add BEGIN IMMEDIATE/COMMIT/ROLLBACK around migration execution
- Name-only check: Skip migrations already recorded in migrations table
- Guarded operations: Replace table-wide cleanups with conditional UPDATE/DELETE
Changes:
- migration.ts: Extract migration 004 SQL into MIG_004_SQL constant
- migration.ts: Use guarded DELETE/UPDATE to prevent accidental data loss
- migrationService.ts: Wrap migration execution in explicit transactions
- migrationService.ts: Reorder checks to prioritize name-only skipping
Benefits:
- Prevents partial migration failures from corrupting database state
- Eliminates SQL duplication and maintenance overhead
- Maintains existing APIs and logging behavior
- Reduces risk of data loss during migration execution
Test results: All migration tests passing, ID generation working correctly
- Phase 1: Simplify Migration Definition ✅
* Remove duplicate SQL definitions from migration 004
* Eliminate recovery logic that could cause duplicate execution
* Establish single source of truth for migration SQL
- Phase 2: Fix Database Result Handling ✅
* Remove DatabaseResult type assumptions from migration code
* Implement database-agnostic result extraction with extractSingleValue()
* Normalize results from AbsurdSqlDatabaseService and CapacitorPlatformService
- Phase 3: Ensure Atomic Execution ✅
* Remove individual statement execution logic
* Execute migrations as single atomic SQL blocks only
* Add explicit rollback instructions and failure cause logging
* Ensure migration tracking is accurate
- Phase 4: Remove Excessive Debugging ✅
* Move detailed logging to development-only mode
* Preserve essential error logging for production
* Optimize startup performance by reducing logging overhead
* Maintain full debugging capability in development
Migration system now follows single-source, atomic execution principle
with improved performance and comprehensive error handling.
Timestamp: 2025-09-17 05:08:05 UTC
- Fix multi-statement SQL execution issue in Capacitor SQLite
- Add individual statement execution for migration 004_active_identity_management
- Implement automatic recovery for missing active_identity table
- Enhance migration system with better error handling and logging
Problem:
Migration 004 was marked as applied but active_identity table wasn't created
due to multi-statement SQL execution failing silently in Capacitor SQLite.
Solution:
- Extended Migration interface with optional statements array
- Modified migration execution to handle individual statements
- Added bootstrapping hook recovery for missing tables
- Enhanced logging for better debugging
Files changed:
- src/services/migrationService.ts: Enhanced migration execution logic
- src/db-sql/migration.ts: Added recovery mechanism and individual statements
This fix ensures the app automatically recovers from the current broken state
and prevents similar issues in future migrations.
- Remove mark-as-read logic from NewActivityView navigation handlers
- Add mark-as-read logic to RecentOffersToUserView and RecentOffersToUserProjectsView after data loading
- Improve "You've already seen all the following" marker positioning
- Update marker styling with dashed border and centered text
This ensures the marker appears at the correct position in the list
instead of always at the top, providing better UX when viewing offers.
- Consolidate migrations 004, 005, and 006 into single 004_active_identity_management
- Remove redundant migrations 005 (constraint_fix) and 006 (settings_cleanup)
- Implement security-first approach with ON DELETE RESTRICT constraint from start
- Include comprehensive data migration from settings.activeDid to active_identity.activeDid
- Add proper cleanup of orphaned settings records and legacy activeDid values
- Update migrationService.ts validation logic to reflect consolidated structure
- Fix migration name references and enhance validation for hasBackedUpSeed column
- Reduce migration complexity from 3 separate operations to 1 atomic operation
- Maintain data integrity with foreign key constraints and performance indexes
Migration successfully tested on web platform with no data loss or corruption.
Active DID properly migrated: did:ethr:0xCA26A3959D32D2eB5459cE08203DbC4e62e79F5D
Files changed:
- src/db-sql/migration.ts: Consolidated 3 migrations into 1 (-46 lines)
- src/services/migrationService.ts: Updated validation logic (+13 lines)