[Fix] PR analytics misses local-day records on non-UTC servers - #2304
Merged
roomote-roomote[bot] merged 1 commit intoSep 7, 2026
Merged
Conversation
Contributor
daniel-lxs
marked this pull request as ready for review
September 7, 2026 03:17
daniel-lxs
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
September 7, 2026 03:17
daniel-lxs
approved these changes
Sep 7, 2026
roomote-roomote
Bot
deleted the
fix/pr-analytics-local-day-3qgx8ji79ww0j
branch
September 7, 2026 03:26
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 changed
PR analytics now uses the same server-local calendar-day cutoff as Costs, Tasks, chart buckets, and summary ranges. Both stored PR filtering and request-time bootstrap reuse the existing cutoff helper, preventing ingestion and display windows from disagreeing.
Added database-backed local-midnight regressions for Los Angeles, Tokyo, spring-forward, and fall-back, plus matching bootstrap cutoff and unbounded-range coverage. Documented the existing server-timezone contract.
Why this change was made
On a non-UTC web server, Today could show a local-day label while excluding earlier records from that same day. In the real local product path with
TZ=America/Los_Angeles, three same-day task/cost fixtures were included but PR analytics included only the 5 PM record because its separate cutoff used UTC midnight. The midnight and 4 PM PRs were visible in All Time, confirming they were persisted.Impact
The corrected Today chart and CSV contain all three local-day PRs and exclude the record one millisecond before local midnight. UTC deployments and all-time queries retain their behavior. This does not change viewer timezone handling, automation scheduling timezone, provider credentials, or synchronization state design.
Validation: eight new regression cases failed before the fix; all nine now pass. The web suite including adjacent cost/session tests passes 17 tests; the SDK bootstrap forwarding suite passes two tests. Web typecheck, formatting, lint, docs build/link checks, and full pre-push checks passed. The initial parallel SDK/web run deadlocked during shared test-database truncation and was not counted; the SDK suite passed when rerun serially with no-test success disabled.
The browser evidence uses disposable local cached PR facts and a temporary Los Angeles server timezone. It exercises real application queries, rendering, and CSV download, not live provider ingestion. Existing provider-forwarding tests and exact-instant source tracing cover the bootstrap boundary. All local fixtures were removed and the server restored to UTC.
Screenshots
Synthetic local data, actual Today view: Sep 6 includes midnight, 4 PM, and 5 PM records for a total of three. These images prove rendered results, not remote ingestion or a recorded before/after sequence.