Skip to content

[Fix] PR analytics misses local-day records on non-UTC servers - #2304

Merged
roomote-roomote[bot] merged 1 commit into
developfrom
fix/pr-analytics-local-day-3qgx8ji79ww0j
Sep 7, 2026
Merged

[Fix] PR analytics misses local-day records on non-UTC servers#2304
roomote-roomote[bot] merged 1 commit into
developfrom
fix/pr-analytics-local-day-3qgx8ji79ww0j

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Opened on behalf of @daniel-lxs. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

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.

Correct local-day PR count on desktop

Correct local-day PR count on mobile

@roomote-community

Copy link
Copy Markdown
Contributor

Reviewing the PR now. Follow

Reviewing 1d18c93

@daniel-lxs
daniel-lxs marked this pull request as ready for review September 7, 2026 03:17
@roomote-roomote
roomote-roomote Bot merged commit eec1a4d into develop Sep 7, 2026
18 of 19 checks passed
@roomote-roomote
roomote-roomote Bot deleted the fix/pr-analytics-local-day-3qgx8ji79ww0j branch September 7, 2026 03:26
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