MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / eventually

Function eventually

graph-ui/tools/pr-2068-feedback-e2e.mjs:40–49  ·  view source on GitHub ↗
(read, predicate, description, timeout = 20000)

Source from the content-addressed store, hash-verified

38const logs = (project, extra = '') => json(`/api/logs?lines=500&min_level=warn${project === undefined ? '' : `&project=${encodeURIComponent(project)}`}${extra}`);
39
40async function eventually(read, predicate, description, timeout = 20000) {
41 const deadline = Date.now() + timeout;
42 let last;
43 while (Date.now() < deadline) {
44 last = await read();
45 if (predicate(last)) return last;
46 await delay(200);
47 }
48 throw new Error(`${description}: ${JSON.stringify(last)?.slice(0, 1200)}`);
49}
50
51async function capture(page, file, locator) {
52 await page.bringToFront();

Callers 3

loadedAlertsFunction · 0.85
refreshAlertsFunction · 0.85
mainFunction · 0.85

Calls 2

readFunction · 0.70
delayFunction · 0.70

Tested by

no test coverage detected