openvibers/openvibe.network Commits

Status page: the developer path names every step; the analytics prune test stops depending on the date (#311)

OP OpenVibers committed 21 days ago · 9976b8f938 · 2 files, +8 −3

* The status page's developer path names every step it runs (app, AI answer, export, Services release were missing)

* The analytics prune test counts the rows actually older than 30 days (its 2026-09-23 fixtures aged past the cutoff on 10-23: 15 removed, not 5)

Changes

ddiff --git a/server/status/routes.js b/server/status/routes.js
iindex cbe2be27..0169bfe8 100644
---- a/server/status/routes.js
++++ b/server/status/routes.js
@@@ -219,7 +219,7 @@ ${tr}
${releaseHealthSection(list, healthSince || generatedAt)}
</section>
<section aria-labelledby="h-devpath"><h2 id="h-devpath">Developer path</h2>
--${devPath ? `<p class="lede">Once a day a test developer account goes from sign-in to a sandbox project, a Media upload, an Events publish and pull, a credential rotation and revocation, and cleanup, through the public API and the SDK. ${lastRun(devPath)}</p>
++${devPath ? `<p class="lede">Once a day a test developer account goes from sign-in to a sandbox project and app, a Media upload, an Events publish and pull, an AI answer, the project export, a Services release, a credential rotation and revocation, and cleanup, through the public API and the SDK. ${lastRun(devPath)}</p>
${proofSteps(devPath)}` : '<p class="lede">The daily developer path has not reported here yet.</p>'}
</section>
<section aria-labelledby="h-toolsjob"><h2 id="h-toolsjob">Tools job proof</h2>
ddiff --git a/test/analytics-privacy.test.js b/test/analytics-privacy.test.js
iindex 93cc6c5b..637f4069 100644
---- a/test/analytics-privacy.test.js
++++ b/test/analytics-privacy.test.js
@@@ -189,9 +189,14 @@ async function dumpAnalytics(db) {
await db.prepare("INSERT INTO analytics_daily (service, date, pageviews, api_calls, unique_visitors) VALUES ('openvibe-network', '2026-07-01', 9, 3, 4) ON CONFLICT (service, date) DO UPDATE SET pageviews = excluded.pageviews, api_calls = excluded.api_calls, unique_visitors = excluded.unique_visitors").run();
const daily = JSON.stringify(await db.prepare('SELECT * FROM analytics_daily ORDER BY date').all());
const before = await db.prepare('SELECT COUNT(*) FROM analytics_events').pluck().get();
++ // Rows the earlier checks wrote on fixed dates (2026-09-23) age past 30 days too, so what goes is every row
++ // older than the cutoff (the five above among them), not exactly five.
++ const old = await db.prepare('SELECT COUNT(*) FROM analytics_events WHERE created_at < ?').pluck().get(sqlTime(Date.now() - 30 * 86400000));
++ assert.ok(old >= 5, `old rows: ${old}`);
const out = await networkAnalytics.schedulePrune(analytics, { days: 30 });
-- assert.strictEqual(out.removed, 5);
-- assert.strictEqual(await db.prepare('SELECT COUNT(*) FROM analytics_events').pluck().get(), before - 5);
++ assert.strictEqual(out.removed, old);
++ assert.strictEqual(await db.prepare('SELECT COUNT(*) FROM analytics_events').pluck().get(), before - old);
++ assert.strictEqual(await db.prepare("SELECT COUNT(*) FROM analytics_events WHERE path = '/@old'").pluck().get(), 1, 'the 29-day-old row stays');
assert.strictEqual(JSON.stringify(await db.prepare('SELECT * FROM analytics_daily ORDER BY date').all()), daily);
assert.strictEqual(await db.prepare('SELECT COUNT(*) FROM users').pluck().get(), 1);
});