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

The digest sends nothing, not an empty email, when nothing happened since the last one #15184

Merged opened this

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

Merged

This pull adds only the pinning test, because an empty window already builds no digest. What I found: digest() in src/feed/digest.ts returns [] for an empty window, not null. I left it that way.

Notes

shipped production is serving it deploy 7a0490b

opened this

This pull adds only the pinning test, because an empty window already builds no digest.

What I found:

  • digest() in src/feed/digest.ts returns [] for an empty window, not null. I left it that way.
  • The caller, sinceDigest in src/web/studio/since.ts, turns an empty result into undefined. feedDigest then returns null, and sinceYouWere renders no card, so nothing is built.
  • There is no email digest sender in the repo. The only digest is the "Since you were here" card, with the same data served on the feed API and MCP. So "the sender skips null" is already satisfied by feedDigest and sinceYouWere.

What changed: test/feed-digest-empty.test.ts. It checks that no events, or only events older than the window, give no lines. It also checks that an empty window gives no digest from sinceDigest, no feedDigest, and no card from sinceYouWere.

What I left out:

  • Changing digest() to return null. That would break its existing callers and tests for no behavioural gain.
  • Last-sent bookkeeping. The last-visit marker is only written by a page visit, and the feed digest is read-only, so there was nothing to advance.

Not proven: this test passes on the current code, so it would not fail "without the change". It would fail if someone later made an empty window render a card.

Try it: bun test test/feed-digest-empty.test.ts. That test passes and bun x tsc --noEmit is clean; I did not run any other test file.

Closes #15163

1 earlier comment · 1 event
commented

This pull adds only the pinning test, because an empty window already builds no digest.

What I found:

  • digest() in src/feed/digest.ts returns [] for an empty window, not null. I left it that way.
  • The caller, sinceDigest in src/web/studio/since.ts, turns an empty result into undefined. feedDigest then returns null, and sinceYouWere renders no card, so nothing is built.
  • There is no email digest sender in the repo. The only digest is the "Since you were here" card, with the same data served on the feed API and MCP. So "the sender skips null" is already satisfied by feedDigest and sinceYouWere.

What changed: test/feed-digest-empty.test.ts. It checks that no events, or only events older than the window, give no lines. It also checks that an empty window gives no digest from sinceDigest, no feedDigest, and no card from sinceYouWere.

What I left out:

  • Changing digest() to return null. That would break its existing callers and tests for no behavioural gain.
  • Last-sent bookkeeping. The last-visit marker is only written by a page visit, and the feed digest is read-only, so there was nothing to advance.

Not proven: this test passes on the current code, so it would not fail "without the change". It would fail if someone later made an empty window render a card.

Try it: bun test test/feed-digest-empty.test.ts. That test passes and bun x tsc --noEmit is clean; I did not run any other test file.

Approved

Test-only pull: pins that an empty or stale window yields no digest lines, no feedDigest and no card. It is clean and small, and it touches no page, so nothing in the preview changes. The security, terminal, docs and dependency items do not apply. The pinning test is useful, but it passes on the base, so it does not prove a change. Two next steps: (1) if the issue wants null from digest(), decide that in the issue instead of leaving the box open; (2) the issue implies an email sender, and src/kernel/mail.ts exists. Confirm whether any mail path sends a digest. If one does, it needs its own skip-on-empty test.

commented

Left #15163 open: 3 unticked items remain (src/feed/digest.ts returns null for an empty window; the sender skips null; bun test passes, with a test that fails without the change).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs