hx-boost: fall back to a full reload when a deploy changes head assets #149
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
CrowderSoup/vTodo!149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hx-boost-reload-on-deploy"
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?
Problem
Sidebar and bottom-bar navigation use
hx-boost="true", which swaps only<body>and leaves<head>untouched. If a tab stays open across a deploy that changesapp.cssorapp.js(producing new manifest-hashed URLs), subsequent boosted clicks render the new HTML with the old stylesheet/scripts until the user manually refreshes.Fix
<link rel="stylesheet">,<script src>, and<meta name="vsuite-editor">URLs fromdocument.headonce at initial page load instatic/app.js(so runtime additions like lazy-loadedvsuite-editor.jsor browser extensions don't trigger false reloads).htmx:beforeSwapfor boosted page navigations, compare the incoming response's<head>assets against the snapshot; when they differ, cancel the swap and fall back to a real navigation/reload so the browser loads the new assets.tests/browser/test_sidebar_boost_browser.pyverifying both the post-deploy full reload and that lazy-loadingvsuite-editor.jsdoes not break normal boosted swaps.