bigskysoftware / bigskysoftware/htmx
Error page can't be swapped on history cache miss
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
As of HTMX 2.0.6, in case of a history cache miss `loadHistoryFromServer()` [checks if the xhr status code falls between 200 and 400](https://github.com/bigskysoftware/htmx/blob/599d152c484cd351aad91159c3dae3c40095fb49/src/htmx.js#L3305), and any error codes (>=400) triggers `htmx:historyCacheMissLoadError`. As far as I can see, this makes it impossible to return with a legitimate, informative error page with the semantically correct HTTP code and have any of the content swapped in.
In my specific situation, I allow swapping of error pages with `responseHandling` in the config, but `codeMatches()` is never used in `loadHistoryFromServer()`.
Is this a bug or intended behaviour? Any advice or something obvious I missed?
Contributor guide
Assessment
This issue has not been assessed yet.