aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-media-cache-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/feed-media-cache-test.js')
-rw-r--r--tools/feed-media-cache-test.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/feed-media-cache-test.js b/tools/feed-media-cache-test.js
index fa90a15..46c485d 100644
--- a/tools/feed-media-cache-test.js
+++ b/tools/feed-media-cache-test.js
@@ -79,7 +79,7 @@ await page.evaluateOnNewDocument(([evs, pk]) => {
const f = m[2] || {};
let out = [];
if ((f.kinds || []).includes(1) && (f.authors || []).includes(pk) && !f['#e'] && !f.ids) {
- window.__reqs.push({ until: f.until, limit: f.limit });
+ window.__reqs.push({ until: f.until, limit: f.limit, since: f.since });
out = evs.filter((e) => !f.until || e.created_at <= f.until).slice(0, f.limit || 30);
}
setTimeout(() => {
@@ -142,7 +142,8 @@ try {
check('all six clips are found, the deepest 150 posts down', await waitFor(() => document.querySelectorAll('.media-grid .media-tile.video').length === 6, 15000), String(await tiles()));
const took = Date.now() - t0;
check('...without waiting on the slow picture along the way', took < 8000, took + ' ms');
- const reqs = await page.evaluate(() => window.__reqs);
+ // (the feed's live watch for new posts — a since-only subscription — isn't the crawl)
+ const reqs = await page.evaluate(() => window.__reqs.filter((r) => !(r.since && !r.until && !r.limit)));
const steps = [...new Set(reqs.map((r) => r.until))]; // each step asks every relay
check('...asking a hundred posts at a time, each step older than the last', reqs.length >= 1 && reqs.every((r) => r.limit === 100 && r.until)
&& steps.every((u, i) => !i || u < steps[i - 1]), JSON.stringify(steps));