Show app + server version at the bottom of settings #289

Closed
opened 2026-06-26 21:47:28 +00:00 by james · 0 comments
Owner

Embed the build version in the app and surface it at the bottom of the settings (account) screen.

Behaviour

  • Web (PWA): one line — Carol <version> — from the bundle's expo.version (read at runtime via expo-constants).
  • Native (Android / Flatpak): two lines — App <version> (from expo-constants) and Server <version> (from GET /api/health via a new useServerVersion hook in @carol/api-client). Shows Checking… while loading and Unknown on failure.

The underlying defect

The version was a static 0.0.0 everywhere: app.json expo.version, root package.json, and apps/api/package.json are all 0.0.0, and the release workflows parsed the git tag but never wrote it anywhere before building. So /api/health always reported 0.0.0 and the Android build's versionName/versionCode never updated per release.

Fix: both release workflows now stamp the tag version before building.

  • release.yml writes the tag version into apps/api/package.json (+ root) before docker build, so /api/health reports the real version.
  • release-android.yml writes expo.version + a monotonic expo.android.versionCode (MAJOR*1000000 + MINOR*1000 + PATCH) into app.json before expo prebuild, so the APK/AAB carry the real versionName/versionCode.
  • Committed package.json/app.json stay at the 0.0.0 dev placeholder — CI is the only writer.

Notes

  • No new runtime env var, so no README change.
  • /api/health isn't in the generated OpenAPI surface (no zod schema), so the new hook calls it through the typed client with a narrow cast rather than hand-authoring the route into the spec.
Embed the build version in the app and surface it at the bottom of the settings (account) screen. ## Behaviour - **Web (PWA):** one line — `Carol <version>` — from the bundle's `expo.version` (read at runtime via `expo-constants`). - **Native (Android / Flatpak):** two lines — `App <version>` (from `expo-constants`) and `Server <version>` (from `GET /api/health` via a new `useServerVersion` hook in `@carol/api-client`). Shows `Checking…` while loading and `Unknown` on failure. ## The underlying defect The version was a static `0.0.0` everywhere: `app.json` `expo.version`, root `package.json`, and `apps/api/package.json` are all `0.0.0`, and the release workflows parsed the git tag but never wrote it anywhere before building. So `/api/health` always reported `0.0.0` and the **Android build's `versionName`/`versionCode` never updated** per release. Fix: both release workflows now stamp the tag version before building. - `release.yml` writes the tag version into `apps/api/package.json` (+ root) before `docker build`, so `/api/health` reports the real version. - `release-android.yml` writes `expo.version` + a monotonic `expo.android.versionCode` (`MAJOR*1000000 + MINOR*1000 + PATCH`) into `app.json` before `expo prebuild`, so the APK/AAB carry the real `versionName`/`versionCode`. - Committed `package.json`/`app.json` stay at the `0.0.0` dev placeholder — CI is the only writer. ## Notes - No new runtime env var, so no README change. - `/api/health` isn't in the generated OpenAPI surface (no zod schema), so the new hook calls it through the typed client with a narrow cast rather than hand-authoring the route into the spec.
james closed this issue 2026-06-26 21:55:57 +00:00
Sign in to join this conversation.
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
james/carol#289
No description provided.