Skip to content

fix: unbreak the WordPress tab layout, decode mail subjects, drop du from page load - #92

Merged
nechodom merged 1 commit into
mainfrom
perf/hosting-detail
Aug 12, 2026
Merged

fix: unbreak the WordPress tab layout, decode mail subjects, drop du from page load#92
nechodom merged 1 commit into
mainfrom
perf/hosting-detail

Conversation

@nechodom

Copy link
Copy Markdown
Owner

1. Layout regression — mine, from v0.27.0

"proč pod setting & limits vidím pluginy?"

The staging-card existence guard I added last release put its {% endif %} inside the actions row instead of after it. With no staging site the opening <div> was skipped while its </div> was still emitted — closing an ancestor early, so every card below (Plugins, Themes) reflowed into the wrong tab.

Balanced now: the guard wraps the whole row, and both branches emit the same number of tags.

2. Mail subjects rendered raw

=?UTF-8?Q?[Ingratia.cz]_Web_byl_aktualizov=C3=A1n_na_WordPre?=

Mail headers are ASCII-only on the wire, so any subject containing an accent — for a Czech site, most of them — arrives RFC 2047 encoded. Added a decoder for Q- and B-encoded words.

Deliberately lenient: an unknown charset, an unknown encoding, or a truncated word comes back unchanged rather than mangled — an ugly subject is still useful, one rewritten into nonsense is not. Display-only; the raw header stays in the log file. Seven tests, including the exact string from the screenshot and four that must survive intact.

3. Hosting detail was slow — du on every page load

The quota probe fell back to du -sk over the site's entire tree, with no timeout, whenever the kernel probe returned 0 — which is every box without kernel quotas, i.e. the default. That ran on every hosting-detail load, before anything rendered: on a 20 GB site with a cold page cache, seconds to tens of seconds — for a figure that is only enforced when quotas are actually on.

The fallback is gone. The caller substitutes the last sampled usage row instead: five minutes stale and instant beats exact and unusable. du still runs — on the sampler's schedule, where taking a while is fine.

Tests

cargo test --workspace green, cargo fmt --all clean.

🤖 Generated with Claude Code

…` from page load

LAYOUT REGRESSION, mine, from the staging-card guard in the previous
release. The `{% endif %}` landed INSIDE the actions row instead of after
it, so when no staging site existed the opening `<div>` was skipped while
its `</div>` was still emitted. That closed an ancestor early and every
card below it — Plugins, Themes — reflowed into the wrong tab. Balanced
now: the guard wraps the whole row, both branches emit the same number of
tags.

MAIL SUBJECTS rendered raw:
`=?UTF-8?Q?[Ingratia.cz]_Web_byl_aktualizov=C3=A1n?=`. Mail headers are
ASCII-only on the wire, so any subject with an accent in it — which for a
Czech site is most of them — arrives RFC 2047 encoded. Added a decoder
for Q- and B-encoded words. Deliberately lenient: an unknown charset, an
unknown encoding or a truncated word comes back UNCHANGED rather than
mangled, because an ugly subject is still useful and one rewritten into
nonsense is not. Display-only; the raw header stays in the log file.

HOSTING DETAIL SPEED. The quota probe fell back to `du -sk` over the
site's entire tree, with no timeout, whenever the kernel probe returned 0
— which is every box without kernel quotas, i.e. the default. That ran on
EVERY hosting-detail page load, before anything rendered: on a 20 GB site
with a cold page cache, seconds to tens of seconds, for a figure that is
only enforced when quotas are actually on. The fallback is gone; the
caller substitutes the last sampled usage row instead. Five minutes stale
and instant beats exact and unusable, and `du` still runs — on the
sampler's schedule, where taking a while is fine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nechodom
nechodom merged commit 2acdaa6 into main Aug 12, 2026
1 check passed
@nechodom
nechodom deleted the perf/hosting-detail branch August 12, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant