Skip to content

refactor: pay down preview-loop reads, reminder re-export, and date-util loops - #4393

Merged
tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-drevz5
Oct 11, 2026
Merged

tyler-dane merged 1 commit into
mainfrom
claude/kind-dirac-drevz5

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

What and why

Nightly simplification of merges after #4392 (#4376-#4392). Four debt items, no behavior change:

  • Preview loop read the same rows three times (feat(backend): founder welcome email preview loop #4381). ensurePreviewLoopForRecipient asked Mongo separately whether a generation had queued rows, whether it was complete, and when it last sent, where the completeness query already fetched every row of the generation. readPreviewGenerationState does one projected read and derives all three. It also resolved the recipient's user id by email only to look the same document up again by _id; since the synthetic preview user document is upserted with that address, one lookup by email answers the unsubscribe check. Five queries per recipient per tick become two.
  • Pass-through re-export (fix(web): sync Google popup reminders and fire event notifications reliably #4377). upcoming-event-reminders.util re-exported DEFAULT_POPUP_REMINDER_MINUTES from google-popup-reminders.util; only two test files used the hop, so they now import from the module that owns the constant. Also drops a const popup = …; return popup; in resolveGooglePopupReminderMinutes.
  • Dead parameter shim (fix(web): resolve ambiguous end times after start time #4380). filterTimeOption accepted string | ParseUserTimeOptions and rewrapped a bare string as { currentValue }; the only production caller (TimePicker) always passed the options object, so the union and the rewrap are gone and the option parameter uses the existing TimeOption type. Tests pass the object.
  • Loop shapes in web.date.util (feat(web): accept flexible go-to date formats in command palette #4386, refactor: fold year-first date patterns and drop form-row test hook #4392 touched this file). getColorsByHour used .map as a forEach with a pushed accumulator plus a formatted label it then threw away; it is now an Array.from over the same 24 indices, with the off-by-one indexing documented. getHourLabels loses the same new Array(n) spread. computeRelativeEventDateRange spelled the prev/next shift out once per duration (four near-identical blocks) and aliased reference to weekRef; one unit plus one sign covers both. computeCurrentEventDateRange and dateIsValid lose their let-then-assign and triple-alias shapes.

Verify

VERDICT: FAIL

Checks run: test:core (934/934), type-check, lint, knip. Skipped: test:a11y, test:e2e (Playwright Chromium missing in sandbox).

Both failures reproduce byte-for-byte on a clean main checkout with no diff applied, and neither lands in a file this diff touches:

  • test:web — web shard 3/6 is killed by the runner's RSS rail (exceeded 5000 MB RSS) in the components/ files, with no assertion failure. Re-running at WEB_TEST_MAX_RSS_MB=12000 shows the same shard allocating without bound (12138 MB), so it is a pre-existing leak in this sandbox, not a slow test. Shards 1, 2, 4, 5 and 6 are green: 3415/3415.
  • test:backend:fast — 600 pass, 13 fail, all GET /api/config and SSE Server specs timing out on socket binds. This container cannot listen on ::, which is also why the Mongo-backed *.db.test.ts suites cannot run here (mongodb-memory-server fails to allocate a port), so the preview-loop db tests are CI's to run.

Focused suites covering the diff: web.date.util + notifier + DateControlsSection 207/207, test:core 934/934.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vmxj2DvRfjKWHCNQGwVwQi


Generated by Claude Code

…til loops

Nightly simplification of merges after #4392 (#4376-#4392).

- Preview loop asked Mongo three separate questions about one generation's
  rows, re-reading the same handful of documents per recipient per tick,
  and resolved the recipient's user id only to look the same document up
  again by `_id`. One read of the rows and one lookup by email now answer
  all of it.
- `upcoming-event-reminders.util` re-exported `DEFAULT_POPUP_REMINDER_MINUTES`
  from its neighbour; only tests used the pass-through, so they import from
  the owning module instead.
- `filterTimeOption` kept a `string | ParseUserTimeOptions` shim from the
  ambiguous-end-time work; production always passed the options object.
- `getColorsByHour` used `.map` as a loop with a pushed accumulator and a
  discarded return value, and `computeRelativeEventDateRange` spelled the
  same prev/next shift out twice.

No behavior change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vmxj2DvRfjKWHCNQGwVwQi
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Oct 11, 2026 — with Claude
@tyler-dane
tyler-dane enabled auto-merge October 11, 2026 10:25
@tyler-dane
tyler-dane added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit 324b298 Oct 11, 2026
27 checks passed
@tyler-dane
tyler-dane deleted the claude/kind-dirac-drevz5 branch October 11, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-automerge Agent-loop finished; merge-guard may squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants