fix(smoke): assert the SPA DOM marker is attached, not visible #29
No reviewers
Labels
No labels
area/auth
area/backend
area/ci
area/deploy
area/e2e
area/frontend
area/shared
blocked
good-first-issue
needs-info
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
celilo/lunacycle!29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-spa-marker-attached"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the last firing lunacycle health-check alert. The app was healthy the whole time — the check was asserting something the health-check host cannot do.
Symptom
The marker element is present, with the right text, at a 1280×720 viewport where the
sm:breakpoint applies.Diagnosis
The failure post-mortem wired up in #20 is what gave it away. In
/tmp/lunacycle-smokeon celilo-mgr:spa-failure.html— the fully rendered app. Every task, category, and the navbar username.spa-failure.requests.txt— all three/apibatch requests succeeded.spa-failure.png— 1280×720, complete layout: icons, cards, colors… and zero text anywhere.celilo-mgr has no fonts installed. No
/usr/share/fonts, no fontconfig,fc-listabsent.Probed it directly on the host with the deployed
playwright-core, unauthenticated against the public login page:Every text box collapses to zero height — there are no glyphs to lay out. Computed
visibilityisvisibleanddisplayisblock; it's the empty bounding box that makes Playwright call it hidden. The only element with real height is the button, and that height is padding.So the alert was firing on the health-check host's font packaging, not on anything about the deployment.
Fix
state: 'attached'— presence, not visibility.That is the assertion this check actually wanted. Its job is to prove the SPA executed and rendered data it had to fetch first. Layout and visibility belong to the e2e suite, which runs in the Playwright container where fonts exist. Tying a production alert to text rendering means it fires on host font packaging instead of on the deployment.
The change is in
runSpaSmokeCheck, so it covers all three callers: thehealth_checkhook, thesmoke-after-deploybus subscriber, and the simulated e2e.Verification
bun run test:unit— 58 passed, 7 files.tsconscripts/smoke/spa-smoke.ts— clean. (Two pre-existingBrowsertype errors in the two celilo hook scripts reproduce identically onmain; they're an artifact of the ad-hoc--ignoreConfiginvocation, not this change.)attachedresolves in 153ms wherevisibletimes out, on the actual host, against the actual deployment./var/celilo/modules/lunacycleis back to its published contents.Also worth doing (not in this PR — your call, it's a host change)
apt install fonts-dejavu-coreon celilo-mgr. Not needed for the check to pass, but the failure screenshots are currently textless, which cost a round trip on this very diagnosis.Status of the other checks on 1.0.4+1
Verified live via
celilo module health lunacycle --debug:smoke_loginpassing with the real bot credentials was the last unverified piece of #20.smoke_spa was the last failing production health check, and the app was healthy the whole time. Playwright reported: 28 × locator resolved to hidden <span class="text-sm hidden sm:inline">smoketest_bot</span> The marker was present with the right text, at a 1280x720 viewport where the sm: breakpoint applies. The failure post-mortem wired up in the previous fix is what gave it away: spa-failure.html holds the fully rendered app and all three /api batch requests succeeded, while spa-failure.png shows the complete layout — icons, cards, colors — with zero text anywhere. celilo-mgr has no fonts: no /usr/share/fonts, no fontconfig. Probed it directly on the host with the deployed playwright-core, unauthenticated: "Waning Gibbous" w=0 h=0 display:block visibility:visible "Sign In" w=382 h=0 display:block visibility:visible "Sign in with Authentik" w=382 h=44 (height is padding, not text) state=attached: OK in 153ms state=visible: FAILED after 5022ms Every text box collapses to zero height because there are no glyphs to lay out, so Playwright calls it hidden. The alert was firing on the health-check host's font packaging, not on the deployment. state: 'attached' is what this check actually wanted. Its job is to prove the SPA executed and rendered data it had to fetch first; layout and visibility belong to the e2e suite, which runs in the Playwright container where fonts exist. Applies to all three callers of runSpaSmokeCheck — the health_check hook, the smoke-after-deploy bus subscriber, and the simulated e2e. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>