You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: the debug page in the brass 1.5.0 fonts (2.29.1) - #305
The brand's brass 1.5.0 fonts on the debug page, as in the camex 6.2.1 pilot (OpenIPC/camex#221):
android/app/src/main/assets/fonts/: BrassSerif-Bold.woff2, BrassMono-Regular.woff2, BrassMono-Bold.woff2 and OFL.txt, byte for byte as the brand ships them (checked against its SHA256SUMS).
DebugServer: /fonts/<file>.woff2 answers only these three files, from the assets (read once), with font/woff2 and Cache-Control: max-age=31536000, immutable; anything else is 404. The other paths keep no-store.
Page CSS: tokens --serif and --mono, three @font-face rules with url(fonts/<file>.woff2?v=<version>); h1–h3 and buttons in var(--serif), everything else in var(--mono). Georgia, Courier New and system-ui are left only inside the tokens.
Unit tests: the fonts are served byte for byte with the year cache and other names get 404; the page uses the fonts only through the tokens.
tests/e2e.sh: optional PAGE_SHOTS=1 opens the page in a headless Chromium next to the emulator (tests/page-fonts.mjs over DevTools, no host port) and checks document.fonts.
The Android menus and dialogs are unchanged. Version 2.29.1 (versionCode 71), CHANGELOG, docs/debug.md.
Checked locally in Docker: unit tests, lint (13 warnings, as the baseline), assembleDebug, check-version.sh; e2e on API 21 and 34: UDP 19/19, TCP 20/20; with PAGE_SHOTS=1 (TCP, API 34) 21/21: Brass Serif and Brass Mono loaded at 1280 and 400 px, h1 computed "Brass Serif", Georgia, …, the board "Brass Mono", "Courier New", monospace (Brass Mono Bold stays unloaded: no bold mono text on the page).
• Bundle Brass Serif and Mono so the debug page uses the brand fonts without external hosting.
• Serve only the three font files with versioned URLs and year-long browser caching.
• Add font-serving and browser checks; document the change and release version 2.29.1.
Merge Risk 🟢 Low
Blast radius 🟢 Low💥 1 capability
1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
The HTML page, its CSS font mapping, and the font asset endpoint form one bounded debug-page presentation capability.
The version query in the page and the Android asset files are propagation steps of that same browser-facing outcome, not independent capabilities.
No separate application or external consumer is reached by the font bytes.
Before: the page used system/font-family fallbacks and the debug server returned 404 for unknown paths.
After: three fixed asset names are mapped to CSS font faces, served from the app asset bundle, cached in memory, and requested with the application version as a query token.
The new correctness conditions are that the allowlist, asset names, CSS family/weight mappings, and versioned URLs remain aligned, and that browser cache transitions fetch the new asset after an APK version change.
The asset read/cache path is a direct transformation with a simple allowlist and fallback, not a new algorithm or coordinated state protocol.
Compatibility_cases applies only to the materially changed browser-cache and fallback-font transition; no concurrent or persistent-state invariant was introduced.
Potential damage 🟢 Low🩹 Cosmetic
Conditionally, if the new asset lookup, CSS mapping, or cache/version association fails, headings, buttons, or body text can render in fallback fonts or the page can retain an older cached font.
The supported impact is visual presentation of the debug page; the page's data, snapshots, logs, controls, and decoder state are not changed by this feature.
Recovery is normally a refresh or installation of the corrected APK; already cached assets expire after the declared cache lifetime or are bypassed by a new version query.
No persistent application state or external effect requires repair.
Revert or install a corrected APK to restore the route/CSS.
A browser may retain an immutable cached response until the versioned URL changes or the cache is cleared, so code rollback alone does not immediately replace every previously cached font.
There is no application-state repair or external compensation prerequisite.
The following are alternative approaches to this PR:
1. Inline fonts in the page
➕ Avoids adding font-serving routes.
➖ Inflates the no-store HTML response and prevents fonts from being cached separately.
Recommendation: Keep the bundled assets and restricted font routes. They support offline LAN access while allowing the browser to cache font bytes independently of the changing debug page.
Files changed (11) +361 / -64 · 3 not counted
Bug fix (4) +116 / -60
BrassSerif-Bold.woff2Bundle the Brass Serif bold fontnot counted
Bundle the Brass Serif bold font
• Adds the WOFF2 asset used for debug-page headings and buttons.
DebugServer.javaServe allowlisted fonts and apply Brass typography+116/-60
Serve allowlisted fonts and apply Brass typography
• Serves three WOFF2 assets through '/fonts/', with year-long immutable caching while other responses retain no-store. Adds versioned font-face URLs and serif/mono CSS tokens to the debug page.
DebugServerTest.javaTest font responses and page font rules+54/-0
Test font responses and page font rules
• Checks font response headers and byte-for-byte asset delivery, rejects other font paths, and verifies the page’s versioned URLs and typography tokens.
e2e.shAdd optional browser font checks to e2e+23/-1
Add optional browser font checks to e2e
• When PAGE_SHOTS is set, runs headless Chromium and a Node DevTools client beside the emulator, records the result, and cleans up the browser container.
page-fonts.mjsCheck loaded fonts and capture page screenshots+64/-0
Check loaded fonts and capture page screenshots
• Uses DevTools to open the debug page at desktop and narrow widths, inspect loaded font faces and computed families, and save full-page screenshots. Exits unsuccessfully if either Brass family is not loaded at either width.
e2e.sh starts the optional Chromium container with an unguarded docker run under set -eu,
rather than recording a failed page check. If the image is unavailable or Docker rejects the start,
the script exits before the subsequent tunnel-restart checks.
2. Browser disconnects can stall test runs✓ Resolved
Description
page-fonts.mjs resolves each DevTools command only when a matching WebSocket message arrives,
without rejecting pending commands on socket closure or enforcing a timeout. If Chromium disconnects
or stops answering after connection, an awaited command remains pending and e2e.sh cannot reach
its cleanup or later checks.
Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link
Browser startup skips later checks: the adb forward, the Chromium start and the DevTools client are one guarded condition now, so a failure is a failed page check and the run goes on; the container and the forward are removed either way. Checked with CHROME_IMAGE=decoder-no-such-image: the page check fails, the other 20 checks pass (the tunnel restart among them).
Browser disconnects can stall test runs: every DevTools command has a 30 s timeout, a closed socket rejects the waiting commands, and the client container runs under timeout 120.
With PAGE_SHOTS=1 (TCP, API 34): 21/21.
Browser startup skips later checks: the adb forward, the Chromium start and the DevTools client are one guarded condition now, so a failure is a failed page check and the run goes on; the container and the forward are removed either way. Checked with CHROME_IMAGE=decoder-no-such-image: the page check fails, the other 20 checks pass (the tunnel restart among them).
Browser disconnects can stall test runs: every DevTools command has a 30 s timeout, a closed socket rejects the waiting commands, and the client container runs under timeout 120.
With PAGE_SHOTS=1 (TCP, API 34): 21/21.
Thanks for the update. I've noted that finding 1 (browser startup skips later checks) and finding 2 (browser disconnects can stall test runs) are both addressed in 85e8bae.
I haven't verified the new code, and I haven't changed either finding's status. If you want the review to re-check the commit, ask me to rerun the review. You can also dismiss the findings yourself if you consider them resolved.
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
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.
Closes #304.
The brand's brass 1.5.0 fonts on the debug page, as in the camex 6.2.1 pilot (OpenIPC/camex#221):
android/app/src/main/assets/fonts/:BrassSerif-Bold.woff2,BrassMono-Regular.woff2,BrassMono-Bold.woff2andOFL.txt, byte for byte as the brand ships them (checked against its SHA256SUMS).DebugServer:/fonts/<file>.woff2answers only these three files, from the assets (read once), withfont/woff2andCache-Control: max-age=31536000, immutable; anything else is 404. The other paths keepno-store.--serifand--mono, three@font-facerules withurl(fonts/<file>.woff2?v=<version>); h1–h3 and buttons invar(--serif), everything else invar(--mono). Georgia, Courier New and system-ui are left only inside the tokens.tests/e2e.sh: optionalPAGE_SHOTS=1opens the page in a headless Chromium next to the emulator (tests/page-fonts.mjsover DevTools, no host port) and checksdocument.fonts.docs/debug.md.Checked locally in Docker: unit tests, lint (13 warnings, as the baseline), assembleDebug,
check-version.sh; e2e on API 21 and 34: UDP 19/19, TCP 20/20; withPAGE_SHOTS=1(TCP, API 34) 21/21: Brass Serif and Brass Monoloadedat 1280 and 400 px, h1 computed"Brass Serif", Georgia, …, the board"Brass Mono", "Courier New", monospace(Brass Mono Bold stays unloaded: no bold mono text on the page).