Public: anyone can read this; the crew can change it.

"origin sync: incremental, event-shaped, and polite > a conditional request is answered from the cache, not refetched" passes every time on a loaded check machine #5258

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/5201-origin-sync-incremental-event-shaped-and → main 1 commit fork

  • Merged. scout/5201-origin-sync-incremental-event-shaped-and was merged into main as 49e8a74.

Review

Sign in to review this change.
1 file changed +8 −1
test/origins-sync.test.ts +8 −1
@@ -6,7 +6,7 @@ import { createApp, type App } from "../src/app.ts";
66 import { serve, type Servers } from "../src/http/server.ts";
77 import { listEvents, type ForgeEvent } from "../src/core/events.ts";
88 import { getCursor, getOriginById } from "../src/core/origins.ts";
9 import { dueOrigins, syncOrigin } from "../src/origins/sync.ts";
9 import { dueOrigins, syncOrigin, syncsSettled } from "../src/origins/sync.ts";
1010 import {
1111 mirrorAndWait,
1212 newFakeState,
@@ -306,11 +306,18 @@ describe("origin sync: incremental, event-shaped, and polite", () => {
306306 "DELETE FROM origin_cursor WHERE key IN ('paused_until','next_sync_at')",
307307 )
308308 .run();
309 // syncOrigin joins a run already in flight (the mirror import and earlier
310 // tests chain syncs), and a joined run began before ETags were on — so it
311 // would cache no validator and the next sweep would be a plain 200. Let
312 // every earlier run finish, then drive exactly one sync per step.
313 await syncsSettled();
309314 fake.state.etagsEnabled = true;
310315 const origin = getOriginById(app.db, originId)!;
311316 await syncOrigin(app, origin);
317 await syncsSettled();
312318 const hitsBefore = fake.state.conditionalHits;
313319 await syncOrigin(app, origin);
320 await syncsSettled();
314321 fake.state.etagsEnabled = false;
315322
316323 // The second sweep sent If-None-Match and got a 304 back — and the labels

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs