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

test: measure the gallery query result without replaying SQL

Adam Eivy2134d76134f5
diff --git a/server/services/mediaAssetIndex/galleryCollections.db.test.js b/server/services/mediaAssetIndex/galleryCollections.db.test.js
index 0f8c3d61a5..be3d050da2 100644
--- a/server/services/mediaAssetIndex/galleryCollections.db.test.js
+++ b/server/services/mediaAssetIndex/galleryCollections.db.test.js
@@ -217,7 +217,8 @@ it('sends no full video detail to SQL and does not spill for the synthetic 2400-
const page = await listGalleryPage({ media: true, kind: 'all', summary: true, hidden: false, compact, limit: 60 });
expect(state.query).toHaveBeenCalledTimes(1);
const [sql, params] = state.query.mock.calls[0];
- const result = await client.query(sql, params);
+ // Measure the actual public-boundary result without executing the same query again.
+ const result = await state.query.mock.results[0].value;
const explained = await client.query(`EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) ${sql}`, params);
const nodes = planNodes(explained.rows[0]['QUERY PLAN'][0].Plan);
return { page, params, videoBytes: Buffer.byteLength(params[0]), resultBytes: Buffer.byteLength(JSON.stringify(result.rows)),