fix(version): judge API/client skew at minor granularity, not patch (MAPPS-372) #433
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-372-minor-version-skew"
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?
Fixes MAPPS-372.
The admin update banner compared the SPA bundle (
client.running) against the server's version (client.latest) by full semver(major, minor, patch), so any patch difference lit it. mokosh-www and mokosh-server ship patch hotfixes independently - the 0.7.1 / 0.7.2 www hotfixes (CSP fix, banner fixes) landed against a 0.7.0 API - so a patch-level divergence is expected and benign, not a mismatch. A 0.7.2 client on a 0.7.0 API was showing "Server needs updating" for no good reason.Per product decision, a patch-outdated API is fine; only a differing major/minor is a real skew worth surfacing.
Fix
(major, minor)release line (newmajor_minorhelper).parse_semverstill validates the fullX.Y.Zshape and stays fail-closed on anything else.update_available()(client behind) fires only when the server is a minor ahead;running_ahead()(server behind) only when the client bundle is a minor ahead. A shared release line (any patch delta, either direction), an unknown, or an unparseable version shows nothing. Multi-digit minors order numerically (0.10 > 0.7).Behaviour
Verification
just pre-commitgreen (fmt + clippy + wasm check +cargo test --lib, 216 tests). Tests rewritten for minor semantics: patch-delta in both directions -> no banner; minor bump -> client behind; minor regression -> server behind; multi-digit minor; equal,None, malformed.docs/versioning.mdsection 1 updated to describe the minor-granularity comparison.