aboutsummaryrefslogtreecommitdiffstats
path: root/tools/profile-recovery-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 08:34:13 -0700
committerAdam Soltys <[email protected]>2026-10-07 08:34:13 -0700
commit6d288aeb194d2765282cf9fd72bd1f5fdd747a71 (patch)
tree9ea340ae990af7e675d0871a80d4d3cdd9b0ac4a /tools/profile-recovery-test.js
parenta6bae186071e7e07136a37f63864d0bf578edd16 (diff)
parentd04f10db5e3c007db2cd8a5f9e12eff55bc1c653 (diff)
downloadcoinosv3-6d288aeb194d2765282cf9fd72bd1f5fdd747a71.tar.gz
coinosv3-6d288aeb194d2765282cf9fd72bd1f5fdd747a71.zip
Merge branch 'worktree-agent-ab051145d709af327'
Diffstat (limited to 'tools/profile-recovery-test.js')
-rw-r--r--tools/profile-recovery-test.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/profile-recovery-test.js b/tools/profile-recovery-test.js
index b2c871a..2f6ae90 100644
--- a/tools/profile-recovery-test.js
+++ b/tools/profile-recovery-test.js
@@ -46,7 +46,9 @@ const bundle = await Bun.build({ entrypoints: ['profile-test-entry'], target: 'b
build.onLoad({ filter: /src\/features\/messages\.js$/ }, async ({ path }) => ({ contents: (await Bun.file(path).text())
.replace("id: 'messages',", "id: 'messages', testFetch: fetchFullProfile, testView: profileScreen, testApply: applyProfile, testLight: (pk) => profiles.get(pk), testFull: (pk) => fullProfiles.get(pk),"), loader: 'js' }));
build.onLoad({ filter: /src\/nostr\.js$/ }, async ({ path }) => ({ contents: (await Bun.file(path).text())
- .replace('export async function queryOn(relays, filter, maxWait = 1500) {', 'export async function queryOn(relays, filter, maxWait = 1500) { if (globalThis.__profileQuery) return globalThis.__profileQuery(relays, filter);'), loader: 'js' }));
+ .replace('export async function queryOn(relays, filter, maxWait = 1500) {', 'export async function queryOn(relays, filter, maxWait = 1500) { if (globalThis.__profileQuery) return globalThis.__profileQuery(relays, filter);')
+ // profile batches stream each answer as it lands (our relays and the indexes at once)
+ .replace('export async function queryStreamOn(relays, filter, onEvent, maxWait = 1500) {', 'export async function queryStreamOn(relays, filter, onEvent, maxWait = 1500) { if (globalThis.__profileQuery) { const evs = await globalThis.__profileQuery(relays, filter); for (const ev of evs || []) onEvent(ev); return; }'), loader: 'js' }));
} }] });
assert(bundle.success, bundle.logs.join('\n'));
const css = await Bun.file('src/style.css').text();