Skip to content

perf page accuracy, nav debug gate, SQLite persistence docs - #5831

Merged
norman-abramovitz merged 6 commits into
cloudfoundry:developfrom
nabramovitz:norm/docs/sqlite-persistence
Aug 20, 2026
Merged

perf page accuracy, nav debug gate, SQLite persistence docs#5831
norman-abramovitz merged 6 commits into
cloudfoundry:developfrom
nabramovitz:norm/docs/sqlite-persistence

Conversation

@nabramovitz

@nabramovitz nabramovitz commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Two related strands, combined per review preference.

Load-performance page: measure what Stratos controls

The diagnostics load-performance page's headline totals accumulated every fetch since navigation, so background traffic inflated them, and nothing explained the pre-response dead zone at the left of the waterfall.

  • Requests / Total transfer now cover the initial load, with post-load traffic tallied separately as since load.
  • A document-fetch phase row decomposes time before first byte into stalled / DNS / TCP / TLS / server wait — a large stall or TLS cost is browser/network setup no app change can recover.
  • Milestones gain a Stratos clock column (time since the request hit the wire, browser and connection setup subtracted), and the waterfall gets a matching clock toggle so the timeline can start at request time.
  • The monaco idle prefetch could fire between Angular bootstrap and the load event, delaying the load milestone and counting the editor payload as initial-load traffic; it now waits for the load event.
  • 304 revalidations report decodedBodySize 0 and were classified as uncached; responseStatus now classifies them correctly.
  • Markdown/JSON exports carry the split, the phases and both clocks.

The measurement APIs used (Navigation/Resource/Paint Timing) are implemented natively across Chromium, Firefox and Safari; per-field gaps (LCP on Safari, responseStatus on older browsers) degrade to n/a or the previous heuristic.

Side-nav 'Show all menu items' checkbox: config-gated

The checkbox is a debugging affordance — it reveals nav entries hidden by endpoint/persistence rules. It now renders only when the deployment's company config opts in via debug.showAllMenuItemsToggle (default off), and a stale saved preference is ignored while the toggle is unavailable so hidden items cannot leak with no visible way to switch them off. Documented in the theme README and theming architecture doc.

Docs: recovery patterns for SQLite deployments

CF pushes without a bound database run on ephemeral SQLite and lose tokens, favorites and settings on every push. New deploy doc covers two recovery patterns for deployments that deliberately stay on SQLite:

  • Continuous replication with Litestream (restore-on-boot + replicate -exec), including the ASG needed for egress and the WAL cross-process caveat with the pure-Go SQLite driver.
  • Snapshot into a user-provided service, with the file-based-vcap-services app feature lifting the ~130KB env cap (a 250KB credential blob verified to round-trip through the Cloud Controller intact) and the go-cfenv >= 1.23 note for combining the feature with bound-database detection.

Both hinge on a stable ENCRYPTION_KEY — the key and the data must persist together. A bound database service remains the production recommendation.

All frontend changes were test-driven (new failing specs first) and live-verified on a deployed CF instance; full check gate green.

requestIdleCallback can fire between Angular bootstrap and the window
load event; a prefetch started in that gap delays the load milestone
and counts the editor payload as initial-load traffic. Schedule the
idle prefetch only once the document has finished loading.
The load-performance page's headline totals accumulated every fetch
since navigation, so background traffic (idle editor prefetch, API
polling) inflated them, and nothing explained the pre-response dead
zone at the left of the waterfall. Now:

- Requests/Total transfer cover the initial load, with post-load
  traffic tallied separately as 'since load'.
- A document-fetch phase row decomposes time before first byte into
  stalled / DNS / TCP / TLS / server wait.
- Milestones show a second 'Stratos clock' column: time since the
  request hit the wire, excluding browser and connection setup the
  app cannot influence. The waterfall gets a matching clock toggle.
- 304 revalidations report decodedBodySize 0, so the cached heuristic
  missed them; responseStatus now classifies them as cached.
- Markdown/JSON exports carry the split, phases and both clocks.
The side-nav 'Show all menu items' checkbox (c5c1009) is a
debugging affordance: it reveals nav entries hidden by endpoint and
persistence rules. Render it only when the deployment's company
config opts in via debug.showAllMenuItemsToggle (default off), and
ignore a stale saved preference while the toggle is unavailable so
hidden items cannot leak with no visible way to switch them off.
The company-config debug block gates the side-nav 'Show all menu
items' checkbox; record it in the CompanyConfig schema reference.
CF pushes without a bound database run on ephemeral SQLite and lose
tokens, favorites and settings on every push or restart. Document two
recovery patterns for deployments that deliberately stay on SQLite:

- Continuous WAL replication with Litestream supervising jetstream
  (restore-on-boot + replicate -exec), including the ASG and
  cross-process WAL caveats.
- Snapshotting the database file into a user-provided service, with
  the file-based-vcap-services app feature lifting the ~130KB env cap
  (a 250KB credential blob round-trips through CC intact).

Both hinge on a stable ENCRYPTION_KEY — the key and the data must
persist together. A bound database service remains the production
recommendation.
Combines the load-performance page accuracy work (initial-load split,
document fetch phases, Stratos clock, monaco prefetch load-gate, 304
cache classification, show-all-menu-items config gate) with the SQLite
persistence documentation, per review preference for a single PR.
@nabramovitz nabramovitz changed the title docs(deploy): recovery patterns for SQLite deployments perf page accuracy, nav debug gate, SQLite persistence docs Aug 20, 2026

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@norman-abramovitz
norman-abramovitz merged commit 9a8332e into cloudfoundry:develop Aug 20, 2026
23 checks passed
@nabramovitz
nabramovitz deleted the norm/docs/sqlite-persistence branch August 20, 2026 04:57
norman-abramovitz pushed a commit that referenced this pull request Aug 20, 2026
The perf-page/nav-gate/sqlite-docs PR (#5831) landed without a
fragment; add one covering its features and fixes plus the persistence
guide. Draft the dependency-updates fragment for the four dependabot
groups, leaving the monaco 0.56 and ESLint 10 moves to their own
entries.
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.

2 participants