Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2tt6qpm3j9 was degraded 54 minutes today: trevato/forge: "flow panel cache > an agent never sees an admin's figures" failed on 3 pulls in the last hour — the lan… #7185
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/7159-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork 1 thread · 1 unresolved
1 file
changed +6
−6
test/flow-panel-cache.test.ts +6 −6
| @@ -18,7 +18,7 @@ beforeAll(async () => { | ||
| 18 | 18 | alice = u.value.id; |
| 19 | 19 | app.db.run("INSERT INTO repo (id, owner_id, name, visibility) VALUES ('pub', ?1, 'pub', 'public')", [alice]); |
| 20 | 20 | app.db.run("INSERT INTO repo (id, owner_id, name, visibility) VALUES ('priv', ?1, 'priv', 'private')", [alice]); |
| 21 | }); | |
| 21 | }, 30_000); | |
| 22 | 22 | afterAll(() => app.close?.()); |
| 23 | 23 | |
| 24 | 24 | /** Statements run against the db, counted. */ |
| @@ -59,13 +59,13 @@ describe("flow panel cache", () => { | ||
| 59 | 59 | expect(panelFigures(app.db, "owner", new Date(t.getTime() + PANEL_TTL_MS))).not.toBe(first); |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | test("an agent never sees an admin's figures", async () => { | |
| 63 | const b = await createUser(app.db, { origin: "seed", trusted: true, username: "scout", email: "[email protected]", password: "a-good-passphrase" }); | |
| 64 | if (!b.ok) throw new Error(b.error); | |
| 65 | app.db.run("UPDATE user SET is_agent = 1 WHERE id = ?1", [b.value.id]); | |
| 62 | test("an agent never sees an admin's figures", () => { | |
| 63 | // no password hashing here: a loaded machine took it past the test's timeout | |
| 64 | const agentId = "agent-scout"; | |
| 65 | app.db.run("INSERT INTO user (id, username, email, password_hash, is_agent) VALUES (?1, 'scout', '[email protected]', 'x', 1)", [agentId]); | |
| 66 | 66 | const ago = new Date(Date.now() - 1_800_000).toISOString(); |
| 67 | 67 | for (const [id, n, repo] of [["a1", 1, "pub"], ["a2", 2, "priv"]] as const) { |
| 68 | app.db.run("INSERT INTO issue (id, repo_id, number, kind, title, body, author_id, state, created_at) VALUES (?1, ?2, ?3, 'pull', 't', '', ?5, 'open', ?4)", [id, repo, n, ago, b.value.id]); | |
| 68 | app.db.run("INSERT INTO issue (id, repo_id, number, kind, title, body, author_id, state, created_at) VALUES (?1, ?2, ?3, 'pull', 't', '', ?5, 'open', ?4)", [id, repo, n, ago, agentId]); | |
| 69 | 69 | app.db.run("INSERT INTO pull (issue_id, base_branch, head_branch, base_oid, head_oid) VALUES (?1, 'main', 'b', '', 'h')", [id]); |
| 70 | 70 | } |
| 71 | 71 | const t = new Date(); |
new above
offline
A 30 s timeout hides slow hashing rather than removing it. Insert the admin directly here too, as the agent test now does.