GET /v1/desktop/download/:releaseId/:name called DesktopReleases.file() with no try/catch, unlike the sibling update-check route. A transient network failure reaching the Gitea releases API threw a raw undici TypeError: fetch failed straight through the route, 500ing the desktop client and reaching errors.bitreport.pt with no file/line (the native undici error has no frame pointing into our code).
Wraps the call in a try/catch like the sibling /v1/desktop/update/... route already does: logs a warning and answers 503 { error: "download_unavailable" } instead of a 500.
Origin: BIT-31961 (error-loop ticket, ERRCLUSTER 937cdb6ca64d, freq 1, no stack location). Traced to apps/api/src/desktop/updates.ts by checking every fetch/fetchImpl call site in apps/api for one that neither wraps network failures into a descriptive error (like zerozero/nextcloud do) nor catches them at the call site.
Test plan
apps/api/test/desktop-updates.test.ts — added a regression test that injects a rejecting fetchImpl and asserts the route answers 503 instead of throwing (npx vitest run test/desktop-updates.test.ts, 4/4 passing).
npx tsc --noEmit clean.
## Summary
- `GET /v1/desktop/download/:releaseId/:name` called `DesktopReleases.file()` with no try/catch, unlike the sibling update-check route. A transient network failure reaching the Gitea releases API threw a raw undici `TypeError: fetch failed` straight through the route, 500ing the desktop client and reaching errors.bitreport.pt with no file/line (the native undici error has no frame pointing into our code).
- Wraps the call in a try/catch like the sibling `/v1/desktop/update/...` route already does: logs a warning and answers `503 { error: "download_unavailable" }` instead of a 500.
Origin: BIT-31961 (error-loop ticket, ERRCLUSTER 937cdb6ca64d, freq 1, no stack location). Traced to `apps/api/src/desktop/updates.ts` by checking every `fetch`/`fetchImpl` call site in apps/api for one that neither wraps network failures into a descriptive error (like zerozero/nextcloud do) nor catches them at the call site.
## Test plan
- [x] `apps/api/test/desktop-updates.test.ts` — added a regression test that injects a rejecting `fetchImpl` and asserts the route answers 503 instead of throwing (`npx vitest run test/desktop-updates.test.ts`, 4/4 passing).
- [x] `npx tsc --noEmit` clean.
GET /v1/desktop/download/:releaseId/:name called DesktopReleases.file()
with no try/catch, unlike the sibling update-check route. A transient
network failure fetching the release/asset from Gitea threw a bare
undici TypeError (no file/line in its stack, since it originates
inside undici) straight through the route handler, landing on the
error hub as an unlocatable "TypeError: fetch failed" and a 500 to the
desktop app instead of a graceful retry signal.
Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8)
Paperclip-Issue: BIT-31961
Paperclip-Run: 431a287c-0cb3-4f73-9288-ac8d20e18df8
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
GET /v1/desktop/download/:releaseId/:namecalledDesktopReleases.file()with no try/catch, unlike the sibling update-check route. A transient network failure reaching the Gitea releases API threw a raw undiciTypeError: fetch failedstraight through the route, 500ing the desktop client and reaching errors.bitreport.pt with no file/line (the native undici error has no frame pointing into our code)./v1/desktop/update/...route already does: logs a warning and answers503 { error: "download_unavailable" }instead of a 500.Origin: BIT-31961 (error-loop ticket, ERRCLUSTER 937cdb6ca64d, freq 1, no stack location). Traced to
apps/api/src/desktop/updates.tsby checking everyfetch/fetchImplcall site in apps/api for one that neither wraps network failures into a descriptive error (like zerozero/nextcloud do) nor catches them at the call site.Test plan
apps/api/test/desktop-updates.test.ts— added a regression test that injects a rejectingfetchImpland asserts the route answers 503 instead of throwing (npx vitest run test/desktop-updates.test.ts, 4/4 passing).npx tsc --noEmitclean.auto-approve: CI success on
c652715707(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
c652715707(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
c652715707(gitea_auto_approve_open_prs_once.py)