From a803b67f4f908712efbc2e4df41a7d3281283381 Mon Sep 17 00:00:00 2001 From: Justin Baur <19896123+justindbaur@users.noreply.github.com> Date: Fri, 8 Mar 2024 09:54:12 -0600 Subject: [PATCH] Consider Higher StateVersion "ready" (#8255) --- libs/common/src/state-migrations/migrate.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/common/src/state-migrations/migrate.ts b/libs/common/src/state-migrations/migrate.ts index b6bcc45eed..61e849f0ba 100644 --- a/libs/common/src/state-migrations/migrate.ts +++ b/libs/common/src/state-migrations/migrate.ts @@ -103,8 +103,12 @@ export async function waitForMigrations( const isReady = async () => { const version = await currentVersion(storageService, logService); // The saved version is what we consider the latest - // migrations should be complete - return version === CURRENT_VERSION; + // migrations should be complete, the state version + // shouldn't become larger than `CURRENT_VERSION` in + // any normal usage of the application but it is common + // enough in dev scenarios where we want to consider that + // ready as well and return true in that scenario. + return version >= CURRENT_VERSION; }; const wait = async (time: number) => {