MCPcopy
hub / github.com/callumalpass/tasknotes / performEarlyMigrationCheck

Method performEarlyMigrationCheck

src/main.ts:487–508  ·  view source on GitHub ↗

* Perform early migration check and state preparation * This runs before any views can be opened to prevent race conditions

()

Source from the content-addressed store, hash-verified

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

Callers 1

onloadMethod · 0.95

Calls 4

initializeSavedViewsMethod · 0.80
needsMigrationMethod · 0.80
performMigrationMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected