Skip to content

perf(events): aggregate past UTC dates in one pass - #446

Open
seonghobae wants to merge 3 commits into
developmentalfrom
perf/events-past-date-aggregation
Open

perf(events): aggregate past UTC dates in one pass#446
seonghobae wants to merge 3 commits into
developmentalfrom
perf/events-past-date-aggregation

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 15, 2026

Copy link
Copy Markdown

Summary

  • rebuilds the still-valuable server-side portion of ⚡ Bolt: 불필요한 배열 할당 및 Date 파싱 최적화 (성능 개선) #399 on the exact current developmental base;
  • adds collectPastUtcDates under the server library boundary instead of keeping date bucketing inline in the route;
  • replaces chained map → filter → map cache-invalidation transforms with one deterministic pass;
  • returns Date[] directly for Prisma invalidation instead of serializing to ISO and reparsing;
  • adds focused tests for first-seen ordering, UTC deduplication, current/future exclusion, timezone boundary behavior, leap-day preservation, and invalid timestamp handling.

Replacement scope

This is the canonical current-base owner for the API-route delta from #399. The chart-side date parsing work is owned by #425/#440 and is not included here. PR #447 was closed as a duplicate after this stronger package-level implementation was identified.

Behavior contract

  • invalid timestamps are skipped, preventing invalid Date values from reaching Prisma;
  • duplicate timestamps on the same UTC day collapse while preserving first-seen day order;
  • the current UTC day and future UTC days are excluded;
  • non-UTC source offsets are interpreted by the represented instant, matching the prior getUTC* date-bucketing semantics;
  • no client timeline, dependency, lockfile, workflow, or bot-journal changes are included.

Exact-head gate

Current exact head: 3d9cf24865297335f81f8f65724403de7a64387b.

Merge only after exact-head CI, central OpenCode coverage evidence, SAST/Semgrep, Security Scan, dependency review, current-head review, zero unresolved actionable threads, and all live branch-protection rules pass. Queued, skipped, cancelled, stale, predecessor-head, status-only, or duplicate-PR evidence is not success.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d06c0fb-5cfa-4964-b506-ddf94abd80dc

📥 Commits

Reviewing files that changed from the base of the PR and between 1c1a161 and 3d9cf24.

📒 Files selected for processing (3)
  • packages/web/src/app/api/events/route.ts
  • packages/web/src/lib/server/usage-date-buckets.test.ts
  • packages/web/src/lib/server/usage-date-buckets.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant