Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: rename cached earliest usage day migration to 304

[._.]/ Adam Eivye3fb13b8e5c3
diff --git a/scripts/migrations/303-cache-earliest-usage-day.js b/scripts/migrations/304-cache-earliest-usage-day.js
similarity index 92%
rename from scripts/migrations/303-cache-earliest-usage-day.js
rename to scripts/migrations/304-cache-earliest-usage-day.js
index a397538fda..19d96cd501 100644
--- a/scripts/migrations/303-cache-earliest-usage-day.js
+++ b/scripts/migrations/304-cache-earliest-usage-day.js
@@ -32,10 +32,10 @@ export async function up({ rootDir }) {
if (usage.earliestActivityDay === earliestActivityDay) return;
usage.earliestActivityDay = earliestActivityDay;
- const tempPath = `${usagePath}.303.tmp`;
+ const tempPath = `${usagePath}.304.tmp`;
await writeFile(tempPath, `${JSON.stringify(usage, null, 2)}\n`);
await rename(tempPath, usagePath);
- console.log('📊 Migration 303: cached earliest usage activity day');
+ console.log('📊 Migration 304: cached earliest usage activity day');
}
export default { up };
diff --git a/scripts/migrations/303-cache-earliest-usage-day.test.js b/scripts/migrations/304-cache-earliest-usage-day.test.js
similarity index 89%
rename from scripts/migrations/303-cache-earliest-usage-day.test.js
rename to scripts/migrations/304-cache-earliest-usage-day.test.js
index b1c2af6cb4..668291b240 100644
--- a/scripts/migrations/303-cache-earliest-usage-day.test.js
+++ b/scripts/migrations/304-cache-earliest-usage-day.test.js
@@ -2,12 +2,12 @@ import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'fs/promises';
import { tmpdir } from 'os';
import { join } from 'path';
-import { up } from './303-cache-earliest-usage-day.js';
+import { up } from './304-cache-earliest-usage-day.js';
const roots = [];
const makeRoot = async () => {
- const root = await mkdtemp(join(tmpdir(), 'migration-303-'));
+ const root = await mkdtemp(join(tmpdir(), 'migration-304-'));
roots.push(root);
await mkdir(join(root, 'data'), { recursive: true });
return root;
@@ -20,7 +20,7 @@ afterEach(async () => {
await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true })));
});
-describe('migration 303 — earliest usage activity day', () => {
+describe('migration 304 — earliest usage activity day', () => {
it('caches the earliest daily or rolled-up activity date', async () => {
const rootDir = await makeRoot();
await writeFile(join(rootDir, 'data', 'usage.json'), JSON.stringify({
diff --git a/server/services/bootstrap.js b/server/services/bootstrap.js
index acd7013504..38976c6a33 100644
--- a/server/services/bootstrap.js
+++ b/server/services/bootstrap.js
@@ -221,7 +221,7 @@ export const bootstrapServices = async ({ io, dataDir, dataReferenceDir, serverD
// worktree-rooted path as a backstop (#1947).
applyDataMigrations: () => runMigrations({ rootDir: resolveInstallRoot(join(serverDir, '..')) }),
- // usage.js and migration 303 both update usage.json. Initialize the service
+ // usage.js and migration 304 both update usage.json. Initialize the service
// only after migrations finish so their whole-file writes cannot race and
// replace a freshly normalized or rolled-up snapshot with stale bytes.
loadUsage,