fix(migrations): resolve NaN issue in gap reconciliation logic

fix(bundle): exclude os module from browser bundle
This commit is contained in:
diegosouzapw
2026-05-02 01:58:28 -03:00
parent 230f0410f7
commit b75b52eefb
3 changed files with 6 additions and 1 deletions

View File

@@ -177,6 +177,7 @@ const nextConfig = {
tls: false,
crypto: false,
process: false,
os: false,
};
}
return config;

View File

@@ -560,7 +560,10 @@ export function runMigrations(db: Database.Database, options?: { isNewDb?: boole
// Do not rely on any highest-version-applied heuristic. We must explicitly
// iterate through all missing files on disk and apply them if they are missing
// from the _omniroute_migrations table.
const highestApplied = applied.size > 0 ? Math.max(...Array.from(applied).map(Number)) : 0;
const numericApplied = Array.from(applied)
.map((v) => Number.parseInt(v, 10))
.filter((n) => !Number.isNaN(n));
const highestApplied = numericApplied.length > 0 ? Math.max(...numericApplied) : 0;
const pending = files.filter((f) => {
const isMissing = !applied.has(f.version);
if (isMissing && Number(f.version) < highestApplied) {

View File

@@ -111,5 +111,6 @@ test("next config webpack client branch disables Node builtins in browser bundle
tls: false,
crypto: false,
process: false,
os: false,
});
});