feat(settings): show what version the server is running - #83
Merged
Merged
Conversation
Features that need a newer server now say so - public profiles, reordering, and shortly the group and tag filters that need the bulk membership reads landing in 1.5.1. "This server doesn't support it yet" is only actionable next to "and here is what you are running", especially for the many people whose server is run by somebody else. So /v1/version, which the app has never called, is fetched once per instance and shown under Settings > Server. Cached against the base URL so switching servers cannot leave the previous one's version on screen, and a failure is not cached, since being offline once should not mean the version stays unknown until the app restarts. The comparison helpers are for WORDING ONLY and say so in their own docs. Whether a feature is used stays decided by asking for it and seeing what comes back - a 404, a 405, a field that is absent - because that is the only thing that survives a self-hoster running a build off main. An unreadable version is "unknown", never "too old": a feature that works must not be withdrawn over a version string we failed to parse. A release candidate counts as having the code it is a candidate for, since telling somebody on 1.5.1-rc1 to upgrade to 1.5.1 for a feature they already have is the worse error. Also fixes ShareExpiryTest, which failed on any JDK whose CLDR data abbreviates September as "Sept" rather than "Sep" - it asserted the formatted string by hand while the formatter deliberately carries no locale, so the date follows the device. The expectation is now built with the same formatter, so it checks that the expiry date is shown rather than pinning CLDR's opinion of the month. It was failing on main before this branch existed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Three features now degrade on older servers and have to say so: public profiles, group and custom-field reordering, and shortly the group and tag filters for tile scoping, which need the bulk membership reads landing in server 1.5.1. "This server doesn't support it yet" is only actionable next to "and here's what you're running" - especially for the many people whose server is run by somebody else and who need to know what to ask for.
What
/v1/versionhas never been called by the app. It is now fetched once per instance and shown under Settings > Server, alongside the API URL.The rule these helpers follow
Version is for wording. Detection decides behaviour. Whether a feature is used stays decided by asking for it and seeing what comes back - a 404, a 405, a field that is absent - because that's the only thing that survives a self-hoster running a build off main, a fork, or a version string nobody anticipated.
Falling out of that:
1.5.1-rc1to upgrade to1.5.1for a feature they already have is the worse error.Ten unit tests cover the parsing and those rules.
Drive-by fix:
ShareExpiryTestFailing on
mainbefore this branch existed, and it would fail or pass on CI depending on the runner's JDK.EXPIRY_FORMATisofPattern("d MMM yyyy")with no locale - correct, since the date on screen should follow the device - but the test asserted"Expired 1 Sep 2026"by hand. Recent CLDR data abbreviates September in en-GB as "Sept", so:The expectation is now built with the same formatter, so the test checks that the expiry date is shown rather than pinning CLDR's opinion of what September is called.