From c29ad4d880e66b616ea5ec0f59caa6846237beb9 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Thu, 3 Dec 2026 18:49:08 +1300 Subject: [PATCH 1/2] frontend: the API client asks for JSON (Accept), so app/'s errors arrive with their description instead of 'Request failed (403)' --- server/frontend/src/api/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/frontend/src/api/client.ts b/server/frontend/src/api/client.ts index d01ca6f9..0bef887d 100644 --- a/server/frontend/src/api/client.ts +++ b/server/frontend/src/api/client.ts @@ -35,7 +35,8 @@ export async function request(method: HttpMethod, path: string, body?: unknow try { res = await fetch(path, { method, - headers: body === undefined ? undefined : { 'Content-Type': 'application/json' }, + // Accept: the app answers errors as JSON (with their description) only to a request that asks for it + headers: body === undefined ? { Accept: 'application/json' } : { Accept: 'application/json', 'Content-Type': 'application/json' }, credentials: 'same-origin', body: body === undefined ? undefined : JSON.stringify(body), }) From dcc2d8b59604b783a8b67ffc232527b587e75e81 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Thu, 3 Dec 2026 18:56:27 +1300 Subject: [PATCH 2/2] on-dev: touch app/database/migrations on the remote when a sync adds or removes a migration, so build.rs lists the new set (rsync keeps a new file's old mtime) --- scripts/on-dev | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/on-dev b/scripts/on-dev index e405c658..b8c037f8 100755 --- a/scripts/on-dev +++ b/scripts/on-dev @@ -71,7 +71,15 @@ fi sync() { ssh "$host" "mkdir -p '$remote'" - rsync -a --no-owner --no-group --delete-after --filter=':- .gitignore' --exclude=.git "$dir/" "$host:$remote/" + local changes + changes=$(rsync -a -i --no-owner --no-group --delete-after --filter=':- .gitignore' --exclude=.git "$dir/" "$host:$remote/") || + die "rsync to $host failed" + # app/build.rs lists the migrations when database/migrations changes, but rsync keeps a new file's old mtime, so cargo + # would build the old list in: touch the folder when a migration was added or removed (not on every sync, which + # would rebuild the app each time). + if printf '%s\n' "$changes" | grep -qE '^([<>]f\+{9}|\*deleting) +app/database/migrations/'; then + ssh "$host" "touch '$remote/app/database/migrations'" + fi } # One remote command, quoted for the remote shell, with the toolchain on PATH and the CPUs pinned.