fix(web): defer login head scripts to stop the chromium credential-fill race (BUNYIP-294) #302
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-294-defer-login-head-scripts"
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?
What
Add
deferto the two third-party CDN<head>scripts inbunyip-web/src/views/layout.rs(Font Awesome kit + htmx) so neither blocks HTML parsing on the hub/loginpage.Why
The
/loginpage (public_shell, wrapped indocument()) loaded both scripts as render-blocking<script src>tags (nodefer/async), so HTML parsing halted at each tag until the third-party CDN responded. Page-ready timing therefore depended on CDN latency. On slow chromium CI the automated credential fill landed before the form had settled, the native POST went out empty, andlogin_post(auth_pages.rs:553) re-rendered the form with empty fields. mokosh-server's e2e saw "the form kept re-rendering with empty fields after submit" only on chromium; firefox, webkit, and the same run'ssetuplogin all passed. The symptom recurred across mokosh PMS-592 and PMS-595, both of which hardened the e2e helper instead of the hub render timing, so the fix belongs here.defermakes the scripts non-render-blocking and runs them in document order after the parse, beforeDOMContentLoaded. htmx stays (the declared Maud + htmx stack); only its load timing changes. No CSP change.Validation
just check-container(fmt + clippy--workspace --all-targets -D warnings+test --workspace --lib) green. Thedeferempty-attribute maud syntax compiles.Full confirmation that the chromium e2e flake is gone needs a green run against staging after this deploys. The Playwright trace that would pin the exact input-clearing event cannot currently be downloaded from Forgejo via
fj(a separate tooling gap).Fixes BUNYIP-294. Relates to mokosh PMS-605 / PMS-592 / PMS-595.