Repository navigation
refactor: pay down preview-loop reads, reminder re-export, and date-util loops - #4393
Merged
Merged
Conversation
…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
enabled auto-merge
October 11, 2026 10:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Nightly simplification of merges after #4392 (#4376-#4392). Four debt items, no behavior change:
ensurePreviewLoopForRecipientasked 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.readPreviewGenerationStatedoes 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.upcoming-event-reminders.utilre-exportedDEFAULT_POPUP_REMINDER_MINUTESfromgoogle-popup-reminders.util; only two test files used the hop, so they now import from the module that owns the constant. Also drops aconst popup = …; return popup;inresolveGooglePopupReminderMinutes.filterTimeOptionacceptedstring | ParseUserTimeOptionsand 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 existingTimeOptiontype. Tests pass the object.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).getColorsByHourused.mapas aforEachwith a pushed accumulator plus a formatted label it then threw away; it is now anArray.fromover the same 24 indices, with the off-by-one indexing documented.getHourLabelsloses the samenew Array(n)spread.computeRelativeEventDateRangespelled the prev/next shift out once per duration (four near-identical blocks) and aliasedreferencetoweekRef; one unit plus one sign covers both.computeCurrentEventDateRangeanddateIsValidlose theirlet-then-assign and triple-alias shapes.Verify
VERDICT: FAILChecks 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
maincheckout 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 thecomponents/files, with no assertion failure. Re-running atWEB_TEST_MAX_RSS_MB=12000shows 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, allGET /api/configandSSE Serverspecs timing out on socket binds. This container cannot listen on::, which is also why the Mongo-backed*.db.test.tssuites cannot run here (mongodb-memory-serverfails to allocate a port), so the preview-loop db tests are CI's to run.Focused suites covering the diff:
web.date.util+ notifier +DateControlsSection207/207,test:core934/934.🤖 Generated with Claude Code
https://claude.ai/code/session_01Vmxj2DvRfjKWHCNQGwVwQi
Generated by Claude Code