feat(THU-448): App version management: track device versions and enforce minimum version (FRONTEND)#986
Open
arienemaiara wants to merge 1 commit into
Open
feat(THU-448): App version management: track device versions and enforce minimum version (FRONTEND)#986arienemaiara wants to merge 1 commit into
arienemaiara wants to merge 1 commit into
Conversation
Semgrep Security ScanNo security issues found. |
PR Metrics
Updated Mon, 15 Jun 2026 19:22:51 GMT · run #1890 |
|
Preview environment deployed 🚀
Stack: Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — |
- Inject package.json version into VITE_APP_VERSION at build time and send it as X-App-Version on authenticated requests - Read minAppVersion from /config and hard-block startup with an UpgradeRequired screen when the client is below it - Add compareSemver helper that returns 0 for unparseable input so malformed values never block the app
d6dc96a to
6b47a2d
Compare
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.
Note
Medium Risk
Changes startup gating and all backend request headers; malformed versions are handled safely, but a correct min version will fully block outdated clients from using the app.
Overview
Adds server-driven minimum client version enforcement:
GET /configcan supplyminAppVersion, and startup compares it to the built-in app version before database or sync initialization.Version plumbing: Vite injects
import.meta.env.VITE_APP_VERSIONfrompackage.json. Backend requests (authenticated HTTP client andgetAuthenticatedHeaders) sendX-App-Versionwhen that value is set.Gate behavior: New
compareSemvercomparesmajor.minor.patch(ignores pre-release/build) and treats unparseable strings as equal so bad config does not hard-block. If the client is below the minimum, init returnsUPGRADE_REQUIREDand the root app shows a dedicated Update required screen instead of the generic error UI.Reviewed by Cursor Bugbot for commit 6b47a2d. Bugbot is set up for automated code reviews on this repo. Configure here.