Repository navigation
fix(status-pages): fast staged loading for public status pages - #504
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…494) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three specs from a self-hoster's report: - 02: secret fields (SMTP password, JWT secret, inbox password) are dropped on first save; test mail ignores env overrides. - 03: Discord webhook delivery was removed in #409 but the UI and docs still offer it. Bring it back as the no-bot fallback. - 04: bot install uses a second redirect URI the public docs never list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Add an updates include token (7-day default window, updatesDays to widen), skip the timeline query when not requested, and load the status0 page as include= then availability,responseTime then updates. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…fix/status-page-staged-loading
…ns' into fix/status-page-staged-loading
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 10, 2026
fclairamb
enabled auto-merge (squash)
October 10, 2026 17:16
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #504 +/- ##
==========================================
+ Coverage 82.67% 82.77% +0.09%
==========================================
Files 1174 1174
Lines 121363 121369 +6
==========================================
+ Hits 100341 100464 +123
+ Misses 21015 20898 -117
Partials 7 7
🚀 New features to boost your workflow:
|
fclairamb
disabled auto-merge
October 10, 2026 18:11
The response-time seam query LEFT JOINed separate p95/p50 CTEs back onto the bin aggregate. SQLite planned one join as a full scan of the materialized ranked CTE per bin (1 754 bins x 58 k probes), so a cold public status page spent 7 s in it and held the only connection, stalling every other query. Computing both percentiles in the same GROUP BY returns identical rows in 0.26 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
/s/{org}/ still made the single full call: only named pages were staged.
It now reads the same three stages from /status-pages/{org}.
Rendering stage 2 blocked the main thread for ~1.8 s in production
(~3 s under Vite) on a 74-resource, 90-day page:
- the availability bar mounted one Radix Tooltip per segment (~6 600)
and formatted every tooltip date up front. It now has one controlled
tooltip per bar, built only for the hovered segment.
- all 74 response-time charts drew at once. They now mount when they
come within 800 px of the viewport, behind a same-height placeholder.
Production build: rows at ~90 ms (was 1.1 s), page ready at ~170 ms,
55 ms of long tasks (was 1.8 s).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the availability stage landed, every resource row grew by 162 px: the bar skeleton was a flat 32 px block and the response-time chart had no placeholder at all. On a narrow screen the hero uptime pill also wrapped in late and pushed the page down by a line. The bar and the chart now have skeletons built from the same boxes and constants as the real components (the bar shares its axis line, with the real labels; the chart its label, plot height, legend and strip). The chart skeleton also stands in while a loaded chart waits to scroll near the viewport. The per-row percentage and the hero pill keep their place with a transparent copy of the same element. Measured on a 74-resource page: 72 rows keep their height to the pixel and CLS at stage 2 is 0 on desktop and mobile. A multi-region chart still adds its 23 px legend, since stage 1 cannot know its regions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The bar, chart, row percentage and header pill placeholders keep the exact boxes of what replaces them, but draw nothing (visibility hidden): no grey block, no animation, no early labels. Rows still keep their height when the availability stage lands. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ult orgs Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each stage query polled on its own, so every 30 s refresh cost three requests. Once all three stages have answered, their merged result is written into the cache of the full read (?include=availability,responseTime,updates), and from then on that one call is the only thing that polls. The seeded entry is fresh, so the first poll waits a full interval. "Show older" refetches the same single read with updatesDays, and a return visit that still finds a full read in the cache skips the stages. Co-Authored-By: Claude Opus 5.5 <[email protected]>
From a 13-minute recording of the page: - Every 30 s refresh re-rendered all 74 rows, their 6 660 bar segments and every mounted chart, even when one number had changed. Sections, rows and the updates timeline are now memoized; refreshes keep unchanged objects (structural sharing), so only changed rows redraw. The incident map they receive is memoized for the same reason. - Stages 2 and 3 started only after React had rendered stage 1 (35 ms in production, ~250 ms under Vite). They are now prefetched the moment stage 1's response arrives. Replaying the recorded responses with their recorded server times, availability shows at ~1.03 s instead of ~1.45 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Public status-page responses carry public, max-age=60, stale-while-revalidate=30 so a CDN can absorb an incident spike. The browser obeys it too: the page polls every 30 s, and most polls were answered from the disk cache, showing data up to 90 s old. apiFetch now fetches with cache: "no-cache", so every poll reaches the server. The header is unchanged: a CDN in front still caches, and the server's 15 s memo absorbs repeated reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dle boots The stage-1 read (?include=) only left once the 300 KB bundle had loaded and React had booted, while the read itself takes ~20 ms on the server. A small inline script in the shell now starts it while the bundle downloads, and on success stages 2 and 3, in the same order as useStagedPublicStatusPage. It reads the page from the path, or from the sp-page meta tag on a custom domain, and leaves TV routes alone. apiFetch takes these promises once, by exact URL, instead of sending the same request again. The script is part of the built shell, so the server's CSP hashes allow it like the theme script. Production build, median of 9: on a 100 ms round trip the read starts at 235 ms instead of 514 ms and the page shows at 531 ms instead of 630 ms. On localhost the read starts at 8 ms instead of 56 ms, and the page shows at the same time since the read costs 2 ms there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fclairamb
enabled auto-merge (squash)
October 10, 2026 22:42
fclairamb
disabled auto-merge
October 10, 2026 23:12
fclairamb
enabled auto-merge (squash)
October 10, 2026 23:14
fclairamb
disabled auto-merge
October 10, 2026 23:14
fclairamb
enabled auto-merge (squash)
October 10, 2026 23:14
Merged
fclairamb
added a commit
that referenced
this pull request
Oct 11, 2026
🤖 I have created a release *beep* *boop* --- ## [0.38.2](v0.38.1...v0.38.2) (2026-10-11) ### Bug Fixes * **dash0:** bug report screenshot shows the viewport, not the top of the page ([#516](#516)) ([114c547](114c547)) * **dash0:** center the auth card on mobile ([#490](#490)) ([ca250f6](ca250f6)) * **dash0:** name a tunneled check's bastion even when it is not on the page ([#512](#512)) ([d1bb246](d1bb246)) * **deps:** update github.com/dop251/goja digest to 73dc7ed ([#503](#503)) ([d2f7bfa](d2f7bfa)) * **deps:** update github.com/dop251/goja digest to a4bedf5 ([#499](#499)) ([638a4bb](638a4bb)) * **deps:** update go dependencies (non-major) ([#517](#517)) ([9f6cbbc](9f6cbbc)) * **security:** address open code scanning and Dependabot alerts ([#514](#514)) ([84dc69d](84dc69d)) * **status-pages:** fast staged loading for public status pages ([#504](#504)) ([a269baa](a269baa)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
The public status page was slow to show anything. On a 74-resource, 90-day page the resources appeared after 1.1 to 1.9 s in production (3 to 4 s under
make dev), and the browser was frozen for most of that time. Three causes, all fixed here.Results (production build, 74 resources, 90 days)
1. Load in stages
?include=: sections, resources with current status, active incidents. First paint.?include=availability,responseTime: availability bars and response-time charts. If it fails, stage 1 stays on screen.?include=updates: recent updates, last 7 days. "Show older updates" asks for the fullhistoryDayswindow with the newupdatesDaysparam./s/{org}/{slug}), custom domains and the org's default page (/s/{org}/) all use it.apiFetchtakes those promises by exact URL. On a 100 ms round trip the page shows ~100 ms sooner (531 vs 630 ms, production build). The script is part of the built shell, so the CSP hashes allow it.?include=availability,responseTime,updates, instead of polling each stage.cache: "no-cache". The server'spublic, max-age=60, stale-while-revalidate=30meant most 30 s polls were answered from the browser's disk cache, with data up to 90 s old. The header is unchanged, so a CDN still caches.2. Slow SQLite query
The response-time seam query (
AggregateResponseTimeBins) joined its p95/p50 CTEs back onto the bins, and SQLite planned one of those joins as a full scan per bin. It took 7 s and held the only connection, so every other query (page lookup, result inserts) queued behind it. Both percentiles are now computed in the same GROUP BY: identical rows, 0.26 s instead of 3.1 s on a copy of the dev database. Postgres is unchanged.3. Rendering cost
API
includetokenupdates, andupdatesDays(positive integer, bounded byhistoryDays, 400 otherwise).includestill returns everything with the fullhistoryDayswindow. The embed widget, the Atom feed and third parties are unchanged.openapi.yamlandweb/docs/docs/features/status-pages.md.Also in this branch
2026-10-10-02-demo-org-no-membership-request.Tests
include=updatesparsing,updatesDaysvalidation, 7-day cap, full window withoutinclude, distinct memo keys. The seam query parity tests pass with the new SQL.make lint-back, status0 lint and typecheck green. Postgres layer not run locally.🤖 Generated with Claude Code