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

opened this

Merged 40d 11h ago, live in production

Home now has a "Since you were here" section, built from #6684's branch with its history kept, and the duplicate pullmerged index is gone. Index: 20261027090000-home-visit.ts now creates only the homevisit table.

Notes

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.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs