* Perform early migration check and state preparation * This runs before any views can be opened to prevent race conditions
()
| 485 | * This runs before any views can be opened to prevent race conditions |
| 486 | */ |
| 487 | private async performEarlyMigrationCheck(): Promise<void> { |
| 488 | try { |
| 489 | // Initialize saved views (handles migration if needed) |
| 490 | await this.viewStateManager.initializeSavedViews(); |
| 491 | |
| 492 | // Perform view state migration if needed (this is silent and fast) |
| 493 | if (this.viewStateManager.needsMigration()) { |
| 494 | await this.viewStateManager.performMigration(); |
| 495 | } |
| 496 | |
| 497 | // Migration check complete |
| 498 | this.migrationComplete = true; |
| 499 | } catch (error) { |
| 500 | tasknotesLogger.error("Error during early migration check:", { |
| 501 | category: "configuration", |
| 502 | operation: "early-migration-check", |
| 503 | error: error, |
| 504 | }); |
| 505 | // Don't fail the entire plugin load due to migration check issues |
| 506 | this.migrationComplete = true; |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | /** |
| 511 | * Check for version updates and show release notes if needed |
no test coverage detected