Tables: Back after a live filter, sort or search can show the bare table fragment instead of the page #646
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#646
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found on 2026-10-01 while reviewing #313 at
0e789674a, by driving Companies in headless Chromium. It is older than #313: a click on a sort icon alone reproduces it.After any live narrowing of a table (a search, a column filter, a sort), opening a company and pressing Back can show the table's fragment as the whole page:
<html><head></head><body><div id="companies-table">…, with no title, no masthead and no styles.Why
The list views answer an htmx request with the table fragment at the page's own address.
get_template_namespicks the partial when the request carriesHX-Request(jobs/views.py:122-125,jobs/listing_views.py:115-118; Applications was not checked and probably shares the pattern). The response saysVary: Accept-Language, Cookieand has noCache-Control, so the browser's HTTP cache holds the fragment under the page's address. When Back asks for that address as a document, the cache hands the fragment back.Limits of the evidence
Fix
Either:
patch_vary_headers(response, ["HX-Request"])on every view that answers the same address with a page or with a fragment (the three list views, and any other found with a grep forHX-Requestinget_template_names), or"getCacheBusterParam": truein thehtmx-configmeta inbase.html.The first is the correct statement of what the response depends on.
Done when
Vary: HX-Request.