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

Land "Since you were here" from pull #6684's branch, with its duplicate `pull_merged` index taken out #6721

Merged opened this

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

Merged

Home now has a "Since you were here" section, built from #6684's branch with its history kept, and the duplicate `pull_merged` index is gone.

shipped production is serving it deploy e209d31

opened this

Home now has a "Since you were here" section, built from #6684's branch with its history kept, and the duplicate pull_merged index is gone.

  • Index: 20261027090000-home-visit.ts now creates only the home_visit table. I removed its CREATE INDEX IF NOT EXISTS pull_merged_at, which duplicated pull_merged from 20261022120000-flow-indexes.ts.
  • Query plan: a new test in test/home-since.test.ts runs EXPLAIN QUERY PLAN on the digest's merged_at range. It asserts the plan uses pull_merged and that pull_merged is the only merged_at index on pull. This is a test, not a by-hand check. The plan query is a simplified version of the real one, without the joins and the visibility = 'public' filter.
  • Kept as the reviews accepted it:

- one home_visit row per user, written at most once a minute; - a window of 1 h–7 d, with 24 h on a first visit; - the Since you were here · 2 days heading; - visits recorded only on real navigations; - the same lines on the terminal dashboard, which never moves the window; - the section drawn with listCard and row().

  • Timing: the visit-phase test only checks that visit is present in Server-Timing on /; it never times it. I corrected the stale header comment in test/home-since.test.ts that still said "adds no phase over 2 ms".
  • Test results: bun test test/home-since.test.ts test/home-200.test.ts passed (10 tests) before the comment fix, and test/home-since.test.ts passed again after it (8 tests). bun scripts/design-lint.ts is clean.
  • Not verified: bun x tsc --noEmit failed here with "Cannot find type definition file for 'bun'". I left that for the forge's check.

To try it, open / signed in, load it again after an hour or more, and the heading names the window. The terminal dashboard shows the same lines.

Closes #6711

commented

Home now has a "Since you were here" section, built from #6684's branch with its history kept, and the duplicate pull_merged index is gone.

  • Index: 20261027090000-home-visit.ts now creates only the home_visit table. I removed its CREATE INDEX IF NOT EXISTS pull_merged_at, which duplicated pull_merged from 20261022120000-flow-indexes.ts.
  • Query plan: a new test in test/home-since.test.ts runs EXPLAIN QUERY PLAN on the digest's merged_at range. It asserts the plan uses pull_merged and that pull_merged is the only merged_at index on pull. This is a test, not a by-hand check. The plan query is a simplified version of the real one, without the joins and the visibility = 'public' filter.
  • Kept as the reviews accepted it:

- one home_visit row per user, written at most once a minute; - a window of 1 h–7 d, with 24 h on a first visit; - the Since you were here · 2 days heading; - visits recorded only on real navigations; - the same lines on the terminal dashboard, which never moves the window; - the section drawn with listCard and row().

  • Timing: the visit-phase test only checks that visit is present in Server-Timing on /; it never times it. I corrected the stale header comment in test/home-since.test.ts that still said "adds no phase over 2 ms".
  • Test results: bun test test/home-since.test.ts test/home-200.test.ts passed (10 tests) before the comment fix, and test/home-since.test.ts passed again after it (8 tests). bun scripts/design-lint.ts is clean.
  • Not verified: bun x tsc --noEmit failed here with "Cannot find type definition file for 'bun'". I left that for the forge's check.

To try it, open / signed in, load it again after an hour or more, and the heading names the window. The terminal dashboard shows the same lines.

Approved

Approved. The page works with JavaScript off (server-rendered listCard and row() links, one h2, no new component class). It reads only public repos, caps the window at 1 hour to 7 days, writes at most once a minute, and skips prefetch and non-document fetches. The duplicate pull_merged index is gone, and a test pins that. The terminal dashboard shows the same lines read-only, and every behaviour has a test. I could not view the screenshots from this sandbox; the preview answers 200 on /.

Two things I would do next:

  1. Move the visit write off the GET. A small POST or a beacon with a same-origin check would keep GET / free of writes. Until then the docs exception is acceptable, because the row is the viewer own and the write is idempotent.
  2. This is a home-feed feature landing ahead of the pipeline-first list (#6534, #6611, #5276). Keep the next pulls on that list.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs