Skip to content

feat(THU-448): App version management: track device versions and enforce minimum version (FRONTEND)#986

Open
arienemaiara wants to merge 1 commit into
THU-448/backendfrom
THU-448/frontend
Open

feat(THU-448): App version management: track device versions and enforce minimum version (FRONTEND)#986
arienemaiara wants to merge 1 commit into
THU-448/backendfrom
THU-448/frontend

Conversation

@arienemaiara

@arienemaiara arienemaiara commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

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 /config can supply minAppVersion, and startup compares it to the built-in app version before database or sync initialization.

Version plumbing: Vite injects import.meta.env.VITE_APP_VERSION from package.json. Backend requests (authenticated HTTP client and getAuthenticatedHeaders) send X-App-Version when that value is set.

Gate behavior: New compareSemver compares major.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 returns UPGRADE_REQUIRED and 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.

@arienemaiara arienemaiara changed the base branch from main to THU-448/backend June 15, 2026 19:04
@github-actions

Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

PR Metrics

Metric Value
Lines changed (prod code) +107 / -0
JS bundle size (gzipped) 🔴 682.3 KB → 737.9 KB (+55.6 KB, +8.2%)
Test coverage 🟢 78.09% → 78.18% (+0.1%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Mon, 15 Jun 2026 19:22:51 GMT · run #1890

@github-actions

Copy link
Copy Markdown

Preview environment deployed 🚀

Service URL
Marketing / blog / docs https://thunderbolt-pr-986.preview.thunderbolt.io
App https://app-pr-986.preview.thunderbolt.io
API https://api-pr-986.preview.thunderbolt.io
Keycloak https://auth-pr-986.preview.thunderbolt.io
PowerSync https://powersync-pr-986.preview.thunderbolt.io

Stack: preview-pr-986 · Commit: d6dc96adb304216ac88561545b3bd7e9f83afe22

Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — demo@thunderbolt.io / demo by default.

- 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
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