Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit de7d365573579316a899b57e2c8184e12661b25a
parent 3bbfe17897c83c13817f817533583d20a751ed8d
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon,  9 Nov 2026 23:14:34 -0500

umtool: the Inbox's project calls read once for the page and the rail's count together (redesign L4)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/lib/inbox/projectCalls.ts | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/umtool/lib/inbox/projectCalls.ts b/umtool/lib/inbox/projectCalls.ts @@ -96,8 +96,20 @@ async function projectCalls(ref: ProjectRef): Promise<Decision[]> { return value; } +// One read at a time: the page and the rail's count ask together, and share it. +const gi = globalThis as typeof globalThis & { __umtoolProjectCallsInflight?: Promise<Decision[]> | null }; + /** Every report video's versions to judge, clips not walked and stale quote checks. Never throws. */ -export async function projectCallsAll(): Promise<Decision[]> { +export function projectCallsAll(): Promise<Decision[]> { + if (gi.__umtoolProjectCallsInflight) return gi.__umtoolProjectCallsInflight; + const p = readAll().finally(() => { + if (gi.__umtoolProjectCallsInflight === p) gi.__umtoolProjectCallsInflight = null; + }); + gi.__umtoolProjectCallsInflight = p; + return p; +} + +async function readAll(): Promise<Decision[]> { try { const refs = (await projectRefs()).filter((r) => kindMakesTakes(r.kind)); const live = new Set(refs.map((r) => r.id));