From b38e8e79a830db217e4368760bb394f562afe4c1 Mon Sep 17 00:00:00 2001 From: Peter Hunnisett <29824554+phBalance@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:25:41 -0700 Subject: [PATCH] fix(migration): don't show FATAL ERROR for initial install of a world --- module/migration.mjs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/module/migration.mjs b/module/migration.mjs index ee9f547b..eccd80d1 100644 --- a/module/migration.mjs +++ b/module/migration.mjs @@ -11,9 +11,7 @@ function getAllActorsInGame() { ]; } -async function willNotMigrate() { - const lastMigration = game.settings.get(game.system.id, "lastMigration"); - +async function willNotMigrate(lastMigration) { // We no longer support migration of things which are too old so that migration doesn't become too complicated. // If anything is too old (based on the elements it supports) then we won't update anything. That list is: // - Last migrated version is before 3.0.76 which is the last version that had custom migration methods @@ -57,7 +55,13 @@ async function migrateToVersion(migratesToVersion, lastMigration, queue, queueTy } export async function migrateWorld() { - if (await willNotMigrate()) return; + const lastMigration = game.settings.get(game.system.id, "lastMigration"); + + // NOTE: If there has never been a migration then the lastMigration is "1.0.0". We don't need to give a warning in this case + // as we know that this system was not around then. + if (lastMigration === "1.0.0") return; + + if (await willNotMigrate(lastMigration)) return; // Chat Card for GM about new version const content = `Version ${