render a repo's tickets board when a pull comes from a fork on another knot
Signed-off-by: dawn <90008@klbr.net>
133 unmodified linesExpand all134135136137138139140141138139140141142143144145146147148263 unmodified linesExpand all412413414415413416417418419420153 unmodified linesExpand all133 unmodified linesExpand all const html = await res.text(); return { status: res.status, html, reads: collected.reads, shared: [...collected.shared].sort(), ms: performance.now() - t };};
// a page is static only if every git read it made was answered: a ref, path or diff the// knot didn't project leaves it to the clientconst accepted = (page) => page.status === 200 && page.reads.every((r) => r.status === 200 || !r.key.startsWith("org.tangled.git."));// a page is static only if every git read of its repo was answered: a ref, path or diff the// knot didn't project leaves it to the client. a fork hosted on another knot gets the same// answer from this knot in the browser, so a pull from one doesn't hold its page backconst REPO_PARAM = /[?&]repo=([^&]*)/;const accepted = (page, did) => page.status === 200 && page.reads.every((r) => r.status === 200 || !r.key.startsWith("org.tangled.git.") || REPO_PARAM.exec(r.key)?.[1] !== did);
const pool = async (items, fn) => { const queue = [...items]; await Promise.all(263 unmodified linesExpand all } else { let page = await renderPage(route); stats.render_ms += page.ms; const deps = [...new Set(page.reads.map((r) => r.key))].sort(); if (!accepted(page)) { if (!accepted(page, repo.did)) { page = null; results.set(route, { deps }); } else { // commit pages link their parents and trees at their own commit: only the log153 unmodified linesExpand all