Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Server texts without em dashes: API errors, push copy, OpenAPI examples

Duarte Santos733c52716a3d
diff --git a/api/coach/config.js b/api/coach/config.js
index 1ff692f2a..1c128469b 100644
--- a/api/coach/config.js
+++ b/api/coach/config.js
@@ -220,7 +220,7 @@ export function clearProfileAuth(uid) {
/* ---------- which credential pays for this job ---------- */
export const SHARED_ACCOUNT_REFUSAL =
- 'This instance is configured with a single shared account — ask your admin to enable per-profile sign-in.';
+ 'This instance is configured with a single shared account. Ask your admin to enable per-profile sign-in.';
/**
* Resolve the credential for one profile, or say why there isn't one. Never throws and never
diff --git a/api/coach/core/adapters/http.js b/api/coach/core/adapters/http.js
index 76c84d0fe..93c043a0a 100644
--- a/api/coach/core/adapters/http.js
+++ b/api/coach/core/adapters/http.js
@@ -125,7 +125,7 @@ export function httpAdapter(spec) {
const key = keyOf(env);
if (!key && !meta.keyOptional) return { code: -1, text: '', stderr: `no API key configured for ${id}`, spawnError: true };
const chosen = model || meta.defaultModel;
- if (!chosen) return { code: 1, text: '', stderr: `no model chosen for ${id} — pick one from the list the endpoint serves` };
+ if (!chosen) return { code: 1, text: '', stderr: `no model chosen for ${id} (pick one from the list the endpoint serves)` };
let body = spec.body({ model: chosen, prompt, system: system || null, schema: schema || null, maxTokens: MAX_OUTPUT_TOKENS });
let retriedWithoutJsonMode = false;
@@ -161,7 +161,7 @@ export function httpAdapter(spec) {
let out;
try { out = spec.readText(data); } catch (e) { out = { error: `unexpected response shape: ${trim(e.message, 100)}` }; }
if (out.error) return { code: 1, text: '', stderr: out.error };
- if (out.truncated) return { code: 1, text: '', stderr: 'the answer was cut off at the output limit — try a smaller plan or a bigger model' };
+ if (out.truncated) return { code: 1, text: '', stderr: 'the answer was cut off at the output limit; try a smaller plan or a bigger model' };
return { code: 0, text: String(out.text || '').trim(), stderr: '' };
}
}
diff --git a/api/coach/routes.js b/api/coach/routes.js
index 3df0d90f0..d8f2ab8b7 100644
--- a/api/coach/routes.js
+++ b/api/coach/routes.js
@@ -17,7 +17,7 @@ import { validateBaseUrl, baseUrlFor } from './core/providers.js';
const USER_ERROR = {
off: 'the Coach is not set up on this instance',
busy: 'the Coach is already thinking about your training',
- cap: 'the Coach is resting — try again tomorrow',
+ cap: 'the Coach is taking a rest day, try again tomorrow',
consent: 'the Coach needs your go-ahead first',
// Verbatim, because it tells the user the one thing that resolves it and names who resolves
// it. A vaguer message here turns into a support question for the person running the box.
diff --git a/api/media.js b/api/media.js
index 6e456224f..1233a296c 100644
--- a/api/media.js
+++ b/api/media.js
@@ -95,8 +95,8 @@ const MESSAGES = {
'media-missing': 'no such file',
'hash-mismatch': 'the file does not match its name',
'storage-full': 'the server is running out of disk space',
- busy: 'too many uploads at once — try again in a moment',
- locked: 'too many uploads — try again later',
+ busy: 'too many uploads at once, try again in a moment',
+ locked: 'too many uploads, try again later',
timeout: 'the upload stalled'
};
/** A refusal the client caused or can act on. The server's catch-all answers it as
diff --git a/api/openapi.yaml b/api/openapi.yaml
index 6c1a11e4b..6139e7c73 100644
--- a/api/openapi.yaml
+++ b/api/openapi.yaml
@@ -398,13 +398,13 @@ paths:
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
- example: { error: "challenge expired — try again" }
+ example: { error: "challenge expired, try again" }
'403':
description: Invite-only and the code became invalid since step 1.
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
- example: { error: "invite code is no longer valid — ask for a new one" }
+ example: { error: "invite code is no longer valid, ask for a new one" }
'409':
description: This credential id is already registered.
content:
@@ -488,7 +488,7 @@ paths:
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
- example: { error: "unknown passkey — create a profile first" }
+ example: { error: "unknown passkey, create a profile first" }
'500':
description: Credential exists but its user record is missing (corrupt db).
content:
@@ -1207,7 +1207,7 @@ paths:
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
- example: { error: "challenge expired — try again" }
+ example: { error: "challenge expired, try again" }
'401':
description: >-
Not signed in — including a session that was ended ("sign out everywhere", a
@@ -1659,8 +1659,8 @@ paths:
application/json:
schema: { $ref: '#/components/schemas/Error' }
examples:
- locked: { value: { error: "too many uploads — try again later", code: "locked", retryAfter: 1740 } }
- busy: { value: { error: "too many uploads at once — try again in a moment", code: "busy", retryAfter: 5 } }
+ locked: { value: { error: "too many uploads, try again later", code: "locked", retryAfter: 1740 } }
+ busy: { value: { error: "too many uploads at once, try again in a moment", code: "busy", retryAfter: 5 } }
'507':
description: The server's disk has less than `MEDIA_MIN_FREE_MB` free (`storage-full`).
content:
@@ -1761,7 +1761,7 @@ paths:
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
- example: { error: "too many uploads — try again later", code: "locked", retryAfter: 1200 }
+ example: { error: "too many uploads, try again later", code: "locked", retryAfter: 1200 }
/api/push/public-key:
get:
@@ -2262,7 +2262,7 @@ paths:
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
- example: { error: "already used — cannot revoke" }
+ example: { error: "already used, cannot revoke" }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404':
@@ -2962,7 +2962,7 @@ components:
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
- example: { error: "too many attempts — try again later", code: "locked", retryAfter: 60 }
+ example: { error: "too many attempts, try again later", code: "locked", retryAfter: 60 }
Busy:
description: Every password check slot and the short queue behind them are taken.
headers:
@@ -2971,7 +2971,7 @@ components:
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
- example: { error: "the server is busy — try again in a moment", code: "busy" }
+ example: { error: "the server is busy, try again in a moment", code: "busy" }
PasswordPolicy:
description: >-
The new password breaks the policy — `too-short` (under 10 characters),
diff --git a/api/push-messages.js b/api/push-messages.js
index 1de80a99f..37861a0b4 100644
--- a/api/push-messages.js
+++ b/api/push-messages.js
@@ -5,18 +5,18 @@ const COPY = {
en: {
restTitle: 'Rest over 💪',
restBody: 'Time for your next set.',
- testBody: 'Test notification ✅ — this is what alerts look like.',
+ testBody: 'Test notification ✅ This is what alerts look like.',
dayFallbackTitle: 'Workout planned today',
dayRoutineSuffix: 'today',
- dayBody: "It's on your plan — let's go 💪",
+ dayBody: "It's on your plan. Let's go 💪",
},
'pt-BR': {
restTitle: 'Descanso terminado 💪',
restBody: 'Hora da próxima série.',
- testBody: 'Notificação de teste ✅ — é assim que os alertas aparecem.',
+ testBody: 'Notificação de teste ✅ É assim que os alertas aparecem.',
dayFallbackTitle: 'Treino planejado para hoje',
dayRoutineSuffix: 'hoje',
- dayBody: 'Está no seu plano — vamos treinar 💪',
+ dayBody: 'Está no seu plano. Bora treinar 💪',
},
};
diff --git a/api/server.js b/api/server.js
index a57c2fed3..467a400e1 100644
--- a/api/server.js
+++ b/api/server.js
@@ -882,7 +882,7 @@ function limitAddress(req) {
return /^\d{1,3}(\.\d{1,3}){3}$/.test(raw) ? raw : 'unknown';
}
function tooMany(res, secs) {
- json(res, 429, { error: 'too many attempts — try again later', code: 'locked', retryAfter: secs }, { 'Retry-After': String(secs) });
+ json(res, 429, { error: 'too many attempts, try again later', code: 'locked', retryAfter: secs }, { 'Retry-After': String(secs) });
}
// Whether the caller's address is paused for `kind`, answering 429 when it is. A route asks this
// again right before the check it guards, with no await in between: the dispatcher asked before
@@ -1199,7 +1199,7 @@ const passwordRoutes = {
inv = invite();
if (!inv) {
audit(req, 'auth.register.fail', { ok: false, name, msg: 'invite-invalid' });
- return json(res, 403, { error: 'invite code is no longer valid — ask for a new one', code: 'invite' });
+ return json(res, 403, { error: 'invite code is no longer valid, ask for a new one', code: 'invite' });
}
}
if (nameTaken(name)) return taken();
@@ -1497,7 +1497,7 @@ const passkeyRoutes = {
const c = takeChallenge(text(body.cid));
if (!c || c.kind !== 'add' || c.uid !== user.id) {
audit(req, 'auth.passkey.fail', { ok: false, user, msg: 'challenge-expired' });
- return json(res, 400, { error: 'challenge expired — try again' });
+ return json(res, 400, { error: 'challenge expired, try again' });
}
const cred = await newPasskey(req, res, c, body, 'auth.passkey.fail', user);
if (!cred) return;
@@ -1610,7 +1610,7 @@ const passkeyRoutes = {
}
if (!c || c.kind !== 'link' || c.lh !== link.h || c.uid !== link.userId) {
audit(req, 'auth.link.fail', { ok: false, uid: link.userId, msg: 'challenge-expired' });
- return json(res, 400, { error: 'challenge expired — try again' });
+ return json(res, 400, { error: 'challenge expired, try again' });
}
const owner = db.users.find(u => u.id === link.userId);
const cred = await newPasskey(req, res, c, body, 'auth.link.fail', owner || { id: link.userId });
@@ -1834,7 +1834,7 @@ const routes = {
const c = takeChallenge(body.cid);
if (!c || c.kind !== 'register' || !c.uid) {
audit(req, 'auth.register.fail', { ok: false, msg: 'challenge-expired' });
- return json(res, 400, { error: 'challenge expired — try again' });
+ return json(res, 400, { error: 'challenge expired, try again' });
}
let verification;
try {
@@ -1865,7 +1865,7 @@ const routes = {
invite = db.invites.find(i => i.code === c.code && !i.usedBy && !i.revoked);
if (!invite) {
audit(req, 'auth.register.fail', { ok: false, name: c.name, msg: 'invite-invalid' });
- return json(res, 403, { error: 'invite code is no longer valid — ask for a new one' });
+ return json(res, 403, { error: 'invite code is no longer valid, ask for a new one' });
}
}
const user = { id: c.uid, name: c.name, created: new Date().toISOString() };
@@ -1898,7 +1898,7 @@ const routes = {
const c = takeChallenge(body.cid);
if (c?.kind !== 'login') {
audit(req, 'auth.login.fail', { ok: false, msg: 'challenge-expired' });
- return json(res, 400, { error: 'challenge expired — try again' });
+ return json(res, 400, { error: 'challenge expired, try again' });
}
const cred = db.creds.find(x => x.id === body.credential?.id);
if (!cred) {
@@ -1906,7 +1906,7 @@ const routes = {
// would let an admin correlate an unknown device across attempts. Nothing here identifies
// the caller beyond the timestamp (and the network, if AUDIT_IP is on).
audit(req, 'auth.login.fail', { ok: false, msg: 'unknown-credential' });
- return json(res, 404, { error: 'unknown passkey — create a profile first' });
+ return json(res, 404, { error: 'unknown passkey, create a profile first' });
}
let verification;
try {
@@ -2330,7 +2330,7 @@ const routes = {
const body = await readBody(req);
const inv = db.invites.find(i => i.code === text(body.code).toUpperCase());
if (!inv) return json(res, 404, { error: 'no such code' });
- if (inv.usedBy) return json(res, 400, { error: 'already used — cannot revoke' });
+ if (inv.usedBy) return json(res, 400, { error: 'already used, cannot revoke' });
db.invites = db.invites.filter(i => i.code !== inv.code);
saveDb();
audit(req, 'admin.invite.revoke', { user: admin, msg: inv.code });
@@ -2491,7 +2491,7 @@ const server = http.createServer(async (req, res) => {
}
// Every scrypt slot and the short queue behind them are taken (password.js).
if (e instanceof BusyError) {
- if (!res.headersSent) json(res, 503, { error: 'the server is busy — try again in a moment', code: 'busy' }, { 'Retry-After': '2' });
+ if (!res.headersSent) json(res, 503, { error: 'the server is busy, try again in a moment', code: 'busy' }, { 'Retry-After': '2' });
return;
}
console.error(key, e);
diff --git a/api/test/push-messages.test.js b/api/test/push-messages.test.js
index a1c85a51b..b8034d5ab 100644
--- a/api/test/push-messages.test.js
+++ b/api/test/push-messages.test.js
@@ -10,12 +10,12 @@ test('localizes every server-generated notification in pt-BR', () => {
});
assert.deepEqual(testPush('pt-BR'), {
title: 'openGym',
- body: 'Notificação de teste ✅ — é assim que os alertas aparecem.',
+ body: 'Notificação de teste ✅ É assim que os alertas aparecem.',
tag: 'test',
});
assert.deepEqual(dayReminderPush('pt-BR', { name: 'Treino A', emoji: '💪' }), {
title: '💪 Treino A hoje',
- body: 'Está no seu plano — vamos treinar 💪',
+ body: 'Está no seu plano. Bora treinar 💪',
tag: 'day-reminder',
});
});
@@ -23,5 +23,5 @@ test('localizes every server-generated notification in pt-BR', () => {
test('keeps the existing English copy as the fallback', () => {
assert.deepEqual(restTimerPush('fr'), restTimerPush('en'));
assert.equal(dayReminderPush('unknown', null).title, 'Workout planned today');
- assert.equal(testPush(undefined).body, 'Test notification ✅ — this is what alerts look like.');
+ assert.equal(testPush(undefined).body, 'Test notification ✅ This is what alerts look like.');
});
diff --git a/api/test/server-media.test.js b/api/test/server-media.test.js
index ed4274036..95b7bdbf1 100644
--- a/api/test/server-media.test.js
+++ b/api/test/server-media.test.js
@@ -287,7 +287,7 @@ test('the hourly budget answers 429 with Retry-After, and is recorded once', asy
assert.equal(r.status, 429);
const retry = +r.headers.get('retry-after');
assert.ok(retry > 3000 && retry <= 3600, `retry-after ${retry}`);
- assert.deepEqual(await r.json(), { error: 'too many uploads — try again later', code: 'locked', retryAfter: retry });
+ assert.deepEqual(await r.json(), { error: 'too many uploads, try again later', code: 'locked', retryAfter: retry });
}
assert.equal((await h.put(M.jpeg(), { uid: U2 })).status, 201, 'per profile, not per instance');
const audit = fs.readFileSync(path.join(h.dataDir, 'audit.log'), 'utf8').trim().split('\n').map(l => JSON.parse(l));
@@ -305,7 +305,7 @@ test('a third upload while two are in flight is refused as busy', async t => {
const r = await h.put(M.jpeg());
assert.equal(r.status, 429);
assert.equal(r.headers.get('retry-after'), '5');
- assert.deepEqual(await r.json(), { error: 'too many uploads at once — try again in a moment', code: 'busy', retryAfter: 5 });
+ assert.deepEqual(await r.json(), { error: 'too many uploads at once, try again in a moment', code: 'busy', retryAfter: 5 });
a.req.destroy(); b.req.destroy();
await sleep(150);
assert.equal((await h.put(M.jpeg())).status, 201, 'the slots come back when the two go away');
diff --git a/api/verify-error.js b/api/verify-error.js
index 9eb5694cd..935680eeb 100644
--- a/api/verify-error.js
+++ b/api/verify-error.js
@@ -7,6 +7,6 @@ const MISCONFIGURED = /unexpected (rp id|authentication response origin|registra
export function verifyError(e, { rpId, origin } = {}) {
const msg = String((e && e.message) || 'verification failed');
if (!MISCONFIGURED.test(msg)) return 'verification failed: ' + msg;
- return `${msg} — this server is configured with RP_ID=${rpId} and ORIGIN=${origin}, and both `
+ return `${msg}. This server is configured with RP_ID=${rpId} and ORIGIN=${origin}, and both `
+ 'must match the address you opened. See docs/SELF_HOSTING.md.';
}
diff --git a/docs/AI_COACH.md b/docs/AI_COACH.md
index 442210f33..a285730b7 100644
--- a/docs/AI_COACH.md
+++ b/docs/AI_COACH.md
@@ -210,7 +210,7 @@ In instance mode it depends on what kind of credential was pasted:
- **A personal credential** — a Claude Code setup token or an OAuth login — **binds to the first
profile that spends it**. Any other profile is refused:
-> This instance is configured with a single shared account — ask your admin to enable
+> This instance is configured with a single shared account. Ask your admin to enable
> per-profile sign-in.
No job runs. That is a refusal, not a warning, on purpose — a warning moves the decision onto