fix(version): judge API/client skew at minor granularity, not patch (MAPPS-372) #433

Merged
nrupard merged 1 commit from fix/MAPPS-372-minor-version-skew into main 2026-07-15 19:29:10 +02:00
Owner

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

  • Compare only the (major, minor) release line (new major_minor helper). parse_semver still validates the full X.Y.Z shape 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).
  • Banner display unchanged: a genuine minor/major skew still shows the full versions.

Behaviour

client (bundle) server (API) banner
0.7.2 0.7.0 none (same 0.7 line)
0.7.0 0.7.9 none
0.7.x 0.8.0 "Update available" (client behind)
0.8.0 0.7.x "Server needs updating" (server behind)
0.7.x 0.10.0 "Update available" (0.10 > 0.7)

Verification

just pre-commit green (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.md section 1 updated to describe the minor-granularity comparison.

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 - Compare only the `(major, minor)` release line (new `major_minor` helper). `parse_semver` still validates the full `X.Y.Z` shape 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). - Banner display unchanged: a genuine minor/major skew still shows the full versions. ## Behaviour | client (bundle) | server (API) | banner | |---|---|---| | 0.7.2 | 0.7.0 | none (same 0.7 line) | | 0.7.0 | 0.7.9 | none | | 0.7.x | 0.8.0 | "Update available" (client behind) | | 0.8.0 | 0.7.x | "Server needs updating" (server behind) | | 0.7.x | 0.10.0 | "Update available" (0.10 > 0.7) | ## Verification `just pre-commit` green (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.md` section 1 updated to describe the minor-granularity comparison.
fix(version): judge API/client skew at minor granularity, not patch
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m46s
Create release / Create release from merged PR (pull_request) Has been skipped
b680ee26bb
The update banner compared the SPA bundle against the server's version 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 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.

Compare only the `(major, minor)` release line (new `major_minor` helper; `parse_semver` still validates the full X.Y.Z shape and stays fail-closed). `update_available()` fires only when the server is a minor ahead (client behind), `running_ahead()` only when the client bundle is a minor ahead (server behind). A shared release line, any patch delta either way, or an unparseable version shows nothing. Multi-digit minors order numerically (0.10 > 0.7).

Tests rewritten for minor semantics (patch-delta both directions -> no banner; minor bump -> client behind; minor regression -> server behind; multi-digit minor; equal, None, malformed). `docs/versioning.md` section 1 updated.

#MAPPS-372

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard scheduled this pull request to auto merge when all checks succeed 2026-07-15 19:28:25 +02:00
nrupard deleted branch fix/MAPPS-372-minor-version-skew 2026-07-15 19:29:11 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!433
No description provided.