trails/e2e
Ullrich Schäfer 1eceb6f1f7 feat(journal): two-instance federation harness + trails↔trails Accept fix (§11)
The 11.4 harness — e2e/federation/: postgres (two DBs) + a Caddy with
an internal CA terminating real HTTPS between two complete journal
containers (journal-a.test / journal-b.test), driven by an opt-in
integration test (FEDERATION_TWO_INSTANCE=1, via run.sh). The driver
seeds users straight into each DB, mints a signed session cookie
(known SESSION_SECRET), follows across instances through the real
/follows/outgoing route, and asserts the full pipeline: Follow →
auto-Accept → settle → first outbox poll → bob's public activity
rendered in alice's /feed with @bob@journal-b.test attribution. Plus a
wire-level 11.3 check: unsigned Create(Note) → 4xx, no DB writes.

And the harness immediately earned its keep — it caught a real
trails↔trails bug Mastodon interop never could: our Follow ids are
fragment URIs on OUR domain, so the Follow embedded in another trails
instance's Accept is cross-origin and Fedify rightly distrusts it;
re-fetching the id returns the actor document, getObject() yields a
Person, and the Accept/Reject/Undo listeners bailed silently — follows
stayed Pending forever. The listeners now fall back to the wire
objectId (captured BEFORE getObject(), which memoizes the fetched
document and changes what objectId reports) validated against our
Follow-id shape + the personal inbox's ctx.recipient. Forgery-safe:
settleOutgoingFollow only matches a Pending row toward the
HTTP-Signature-authenticated sender.

Supporting changes:
- federation.server.ts: env-gated allowPrivateAddress
  (FEDERATION_ALLOW_PRIVATE_ADDRESS=true) so the harness's RFC 1918
  Docker network is fetchable — testing only, loudly documented.
- Root .dockerignore: local builds shipped a 1GB+ context and
  overlaid host (darwin) node_modules over the image's own install
  via COPY . . — CI never noticed because it builds from clean
  checkouts. Context is now ~5MB.
- tasks.md: 11.1–11.7 marked with provenance notes; design.md gains
  the cross-origin embedded-object lesson.

Gate: typecheck ✓ lint ✓ unit+integration (FEDERATION_INTEGRATION=1) ✓
e2e 71/72 + known komoot flake green isolated ✓ harness run clean from
scratch (2/2, teardown included) ✓

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 13:36:35 +02:00
..
federation feat(journal): two-instance federation harness + trails↔trails Accept fix (§11) 2026-06-07 13:36:35 +02:00
fixtures Stabilize e2e against Vite dev hydration race 2026-05-08 01:06:27 +02:00
helpers Split planner E2E tests into focused feature files 2026-05-22 21:58:10 +02:00
auth.test.ts Drop workers=1 — hydration helper is sufficient 2026-05-08 01:10:15 +02:00
demo-bot.test.ts Fix e2e fallout from default-private profile_visibility 2026-04-25 23:46:56 +02:00
explore.test.ts Stabilize e2e against Vite dev hydration race 2026-05-08 01:06:27 +02:00
integration.test.ts fix(journal): single-use JWT enforcement for route callback tokens (#2 Phase B) 2026-05-26 00:38:08 +02:00
journal-planner-save.test.ts test(e2e/journal-planner-save): pass waypoints in URL + mock BRouter 2026-05-26 00:53:16 +02:00
journal.test.ts Rebuild the Journal home around a public feed and flagship marketing 2026-04-24 20:00:23 +02:00
komoot-import.test.ts Make listImportable resilient to Komoot API errors; fix import E2E test 2026-05-23 11:05:15 +02:00
notifications.test.ts Stabilize e2e against Vite dev hydration race 2026-05-08 01:06:27 +02:00
planner-coloring.test.ts test(e2e/planner-coloring): bump canvas timeout 10s→20s 2026-05-25 23:44:53 +02:00
planner-multiday.test.ts Split planner E2E tests into focused feature files 2026-05-22 21:58:10 +02:00
planner-overlays.test.ts Split planner E2E tests into focused feature files 2026-05-22 21:58:10 +02:00
planner-routing.test.ts Split planner E2E tests into focused feature files 2026-05-22 21:58:10 +02:00
planner-session.test.ts Split planner E2E tests into focused feature files 2026-05-22 21:58:10 +02:00
public-content.test.ts Stabilize e2e against Vite dev hydration race 2026-05-08 01:06:27 +02:00
settings.test.ts Redesign navbar with avatar dropdown and mobile drawer 2026-04-26 09:56:20 +02:00
social.test.ts feat(journal): outbound trails-to-trails follows (social-federation §6) 2026-06-07 11:50:35 +02:00