diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b11995..842a878 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog -## Unreleased +## v1.3.6 — 2026-09-12 -What the Discord and GitLab reports after v1.3.5 had in common: the Coach failed and nobody could -see why. Web bundle and APK; the API image only for the payload change. +Sync you can trust and a phone that behaves: signed in, the server's profile is always the truth, two devices merge instead of overwriting each other, the app polls for changes and works offline with a banner; reminders and push subscriptions heal themselves; chip rows, sheets under the notch and the tab bar are fixed on iOS; the twelve Astra findings, eleven community merges and a headless QA sweep of every screen. Web bundle, APK and API image. + +**The Coach reports after v1.3.5 had one thing in common: it failed and nobody could see why.** **Bug round (2026-09-12) — the reports from the owner's own phone:** push late or missing, desktop and phone out of step, the Exercises chip rows scrolling the page, sheets under the Dynamic Island, the diff --git a/README.md b/README.md index 32d6897..40226a9 100644 --- a/README.md +++ b/README.md @@ -215,9 +215,9 @@ host side of that volume, not the variable. ## Roadmap The plan lives in [ROADMAP.md](ROADMAP.md) (the -[GitLab milestones](https://gitlab.com/DuarteSantos8/opengym/-/milestones) track the same items): v1.3.5 programmes and +[GitLab milestones](https://gitlab.com/DuarteSantos8/opengym/-/milestones) track the same items): v1.3.7 programmes and progression (explicit warm-up/work phases, AMRAP driver selection, multi-week programmes, adaptive -1RM), v1.3.6 accounts and sync (password and OIDC login, personal-trainer role, remote MCP), v1.3.7 +1RM), v1.3.8 accounts and sync (password and OIDC login, personal-trainer role, remote MCP), v1.3.9 mobile (timer in the notification bar, widgets, Withings). Ideas and pull requests welcome. ## Tech diff --git a/ROADMAP.md b/ROADMAP.md index 4e56b93..fd5c1db 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -57,7 +57,19 @@ Left over from this block: - A real pause for the workout timers (#29 asked for it) - Discord announcement (owner) -## v1.3.5 — Programmes & progression (October 2026) +## v1.3.6 — Sync, push and the phone (released 2026-09-12) + +Signed in, the server's profile is the truth: sign-in adopts it, two devices merge on a server +revision instead of overwriting each other, the app polls for changes and works offline with a +banner. Reminders fire up to 15 minutes late rather than never, push subscriptions re-register +themselves, rest-timer alerts are per device. iOS: chip rows scroll sideways only, sheets clear the +Dynamic Island, the tab bar stays put after the keyboard, the home-screen app reloads offline. The +twelve Astra findings, eleven community merges (weigh-in switch, Swiss German, iOS 26 build, PDF on +the phone, nginx resolver, custom-exercise equipment, per-side data, warm-up rest) and a headless +QA sweep of every screen. Left over: routine reordering (#142), the Smith-bar "no bar" option +(#138), two decimals (#139), delete user in the admin (#107). + +## v1.3.7 — Programmes & progression (October 2026) **Theme: training structure beyond one weekly template.** Most of this is the Space-Hermes series. It changes the training model (per-set roles, explicit phases, normalisation on every persist), so @@ -81,7 +93,7 @@ it goes in one MR at a time, each rebased and tested on gym-test before the next - Catalogue cleanup: exercises that should not carry weight, incline and interval fields for cardio (#46); timers for planks and outdoor cardio are already there, document them (#45) -## v1.3.6 — Accounts & sync (November 2026) +## v1.3.8 — Accounts & sync (November 2026) **Theme: who may sign in, and what else may read or write your data.** @@ -99,7 +111,7 @@ it goes in one MR at a time, each rebased and tested on gym-test before the next logged sessions lost after editing a routine (#25) - Admin: per-user export, invite management, audit log filters -## v1.3.7 — Mobile (December 2026) +## v1.3.9 — Mobile (December 2026) **Theme: the Android app catches up with the web app.** diff --git a/api/openapi.yaml b/api/openapi.yaml index 876deae..c70c384 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -6,7 +6,7 @@ openapi: 3.1.0 info: title: openGym API - version: 1.3.5 + version: 1.3.6 summary: Passkey (WebAuthn) auth + per-user state storage for openGym description: | The backend of [openGym](https://opengym.duarte-santos.ch) — a free, open-source diff --git a/api/package-lock.json b/api/package-lock.json index 0075e84..b98e465 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -1,12 +1,12 @@ { "name": "gym-api", - "version": "1.3.5", + "version": "1.3.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gym-api", - "version": "1.3.5", + "version": "1.3.6", "license": "AGPL-3.0-or-later", "dependencies": { "@simplewebauthn/server": "^13.1.1", diff --git a/api/package.json b/api/package.json index c799536..c2b4c27 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "gym-api", - "version": "1.3.5", + "version": "1.3.6", "private": true, "type": "module", "main": "server.js", diff --git a/frontend/android/app/build.gradle b/frontend/android/app/build.gradle index e0bae38..bd4f9ef 100644 --- a/frontend/android/app/build.gradle +++ b/frontend/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "ch.duartesantos.opengym" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 19 - versionName "1.3.5" + versionCode 20 + versionName "1.3.6" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7b7ff5b..c4aaf40 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "opengym-frontend", - "version": "1.3.5", + "version": "1.3.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opengym-frontend", - "version": "1.3.5", + "version": "1.3.6", "license": "AGPL-3.0-or-later", "dependencies": { "@aparajita/capacitor-secure-storage": "^7.1.6", diff --git a/frontend/package.json b/frontend/package.json index daf84a0..75330b4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "opengym-frontend", "private": true, - "version": "1.3.5", + "version": "1.3.6", "type": "module", "scripts": { "dev": "vite", diff --git a/website/api.html b/website/api.html index febc884..87dd963 100644 --- a/website/api.html +++ b/website/api.html @@ -1,6 +1,6 @@ @@ -232,8 +232,8 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon

OpenAPI 3.1.0 - openGym v1.3.5 - 28 endpoints + openGym v1.3.6 + 30 endpoints AGPL-3.0-or-later

@@ -548,7 +548,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon Sign out everywhere
-

Bumps the account's session version, which invalidates every cookie and Bearer token ever issued for it — on every device, including a copy someone walked off with. Passkeys are untouched; signing back in works immediately. Also clears the caller's own cookie.

+

Bumps the account's session version, which invalidates every cookie and Bearer token ever issued for it — on every device, including a copy someone walked off with. Passkeys are untouched; signing back in works immediately. Also clears the caller's own cookie. Unredeemed pairing codes for the account are voided too.

Requires a session — the cookie set at sign-in, or Authorization: Bearer <token> from mobile-app pairing.

@@ -649,7 +649,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon Pull the account's app state
-

Returns the caller's entire app state as one JSON blob, or {"state": null} if nothing has been synced yet. Sync conflict resolution happens client-side (last-writer-wins by the client-set _ts timestamp).

+

Returns the caller's entire app state as one JSON blob, or {"state": null} if nothing has been synced yet, together with rev, the server's revision of that document (0 when there is none). A client keeps the rev it last read or wrote and sends it back as baseRev on the next push, which lets the server refuse a write over a document the client never saw (see the 409 on PUT).

Requires a session — the cookie set at sign-in, or Authorization: Bearer <token> from mobile-app pairing.

@@ -657,7 +657,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon
200 - The stored state, or null.{ state: State | null } + The stored state, or null, and its revision.{ state: State | null, rev: integer }
401 @@ -676,6 +676,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon

Replaces the stored state wholesale (atomic write; there is no merge on the server). The active field — an in-progress workout — is stripped before saving: a running session belongs to the device running it. Body limit 5 MiB.

+

With baseRev the write is conditional: it goes through only when baseRev equals the document's current revision, and answers 409 with the current document otherwise — the client merges the two and pushes again with the revision it was given. Without baseRev the write is unconditional (clients from before revisions, and deliberate replaces such as a backup import). The server stamps the new revision into the document as _rev; a _rev sent by the client is ignored.

Requires a session — the cookie set at sign-in, or Authorization: Bearer <token> from mobile-app pairing.

Request body (JSON)

@@ -684,20 +685,29 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon State
+
+ baseRev + integer | null + The revision this client last read or wrote. Omit or null for an unconditional overwrite. +

Responses

200 - Saved.{ ok: always true, ts: number | null } + Saved.{ ok: always true, ts: number | null, rev: integer }
400 - state missing or not an object.{"error":"state required"} + state missing or not an object, or workouts/routines set to anything other than an array or null.{"error":"state required"} · {"error":"invalid state"}
401 No session, expired/revoked session, or a disabled account.{"error":"not signed in"} +
+
+ 409 + baseRev is not the current revision — another client wrote since this one last read. Carries the current document so the client can merge and retry.
@@ -740,7 +750,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon Register a Web-Push subscription
-

Stores the browser's PushSubscription for this account. Only endpoint and the two protocol keys are kept. The endpoint must be a public https:// URL — private/loopback/link-local addresses are refused (here and again at send time, against DNS rebinding). At most 20 subscriptions per user; the oldest are dropped first. Re-subscribing an existing endpoint replaces it.

+

Stores the browser's PushSubscription for this account. Only endpoint and the two protocol keys are kept. The endpoint must be a public https:// URL — private/loopback/link-local addresses are refused (here and again at send time, against DNS rebinding). At most 20 subscriptions per user; the oldest are dropped first. Re-subscribing an existing endpoint replaces it and keeps its original created — the client re-sends its subscription on every signed-in boot, so a row the instance lost comes back on its own.

Requires a session — the cookie set at sign-in, or Authorization: Bearer <token> from mobile-app pairing.

Request body (JSON)

@@ -749,6 +759,11 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon PushSubscription
+
+ deviceId + string + A token the browser made up for itself (stored in its localStorage), so rest-timer pushes can be aimed at the device that started the rest. Optional; anything that is not a short token is ignored. +

Responses

@@ -768,6 +783,38 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon
+
+ + GET + /api/push/status + + Does the server hold this subscription? + +
+

Whether the caller's account has a stored subscription with exactly this endpoint. The browser's PushManager.getSubscription() says nothing about the server's side — a row pruned after a dead send (404/410/403) leaves the browser subscribed to nowhere — so the client asks here before showing the notifications switch as on, and re-registers when the answer is no.

+

Requires a session — the cookie set at sign-in, or Authorization: Bearer <token> from mobile-app pairing.

+

Query parameters

+
+ endpointrequired + string (uri) + +
+
+ +

Responses

+
+
+ 200 + The answer.{ subscribed: boolean } +
+
+ 401 + No session, expired/revoked session, or a disabled account.{"error":"not signed in"} +
+
+
+
+
POST @@ -808,7 +855,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon Send a test notification
-

Sends a test push to all of the caller's subscriptions (localized with the lang in their synced state). Returns 200 even if delivery to individual endpoints fails — dead endpoints (404/410) are pruned as a side effect.

+

Sends a test push to all of the caller's subscriptions (localized with the lang in their synced state). Returns 200 even if delivery to individual endpoints fails — dead endpoints (404/410, and 403 for a subscription made against a VAPID key the instance no longer has) are pruned as a side effect.

Requires a session — the cookie set at sign-in, or Authorization: Bearer <token> from mobile-app pairing.

@@ -834,7 +881,7 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon Schedule a server-side rest-timer push
-

Schedules one push after seconds (clamped to 1–3600; one pending timer per user, a new call replaces it). The client schedules this on rest start/extend and cancels on skip or on-screen completion — the push only actually fires when the tab was backgrounded/suspended and never got to cancel it.

+

Schedules one push after seconds (clamped to 1–3600). One pending timer per device — deviceId, the same token the subscription was registered with; a new call from the same device replaces it, and the push goes only to that device's subscriptions. Without a deviceId there is one timer per account and the push goes to every subscription, as before. The client schedules this on rest start/extend and cancels on skip or on-screen completion — the push only actually fires when the tab was backgrounded/suspended and never got to cancel it. Timers live in memory: an API restart drops them.

Note: the documented 400 seconds required exists in the code but is unreachable — the clamp turns any missing/invalid value into 1.

Requires a session — the cookie set at sign-in, or Authorization: Bearer <token> from mobile-app pairing.

@@ -844,9 +891,15 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon number (1–3600)
+
+ deviceId + string + The browser's own token, see POST /api/push/subscribe. Optional. +
{
-  "seconds": 90
+  "seconds": 90,
+  "deviceId": "3f9c1d2e7b0a4c6d9e8f1a2b3c4d5e6f"
 }

Responses

@@ -870,10 +923,16 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon Cancel the pending rest-timer push
-

Cancels the caller's scheduled rest-timer push, if any. Idempotent.

+

Cancels the caller's scheduled rest-timer push, if any. With a deviceId only that device's timer; without one, every pending timer of the account. Idempotent.

Requires a session — the cookie set at sign-in, or Authorization: Bearer <token> from mobile-app pairing.

- +

Request body (JSON) (optional)

+
+ deviceId + string + +
+

Responses

@@ -1570,13 +1629,18 @@ main.api-main .lead { color: var(--fg-2); max-width: 58ch; margin: 14px 0 0; fon The whole app state as one blob.
-

The server treats it as opaque (it only strips active on save and reads a few fields for reminders and the admin dashboard) — the schema below is representative, not enforced, and grows with the app. Conflict resolution is client-side via _ts.

+

The server treats it as opaque (it only strips active on save and reads a few fields for reminders and the admin dashboard) — the schema below is representative, not enforced (except workouts and routines, which must be arrays (or null) when present), and grows with the app. Concurrent writes are caught by the server's revision (_rev, see PUT /api/data); the client merges the two documents and decides by _ts which side's settings win.

_ts number Client-set last-write timestamp (ms since epoch); drives sync.
+
+ _rev + integer + Server-set revision, incremented on every accepted PUT. Ignored when sent by a client. +
unit "kg" | "lb" diff --git a/website/index.html b/website/index.html index f26de07..05a801d 100644 --- a/website/index.html +++ b/website/index.html @@ -404,7 +404,7 @@ try {
Download for Android -

v1.3.5 · 27.7 MB · Android 6.0+ · signed APK. Your browser will ask +

v1.3.6 · 27.7 MB · Android 6.0+ · signed APK. Your browser will ask before installing; that is normal outside the Play Store.

Every release is also built and signed by CI and attached to the GitHub