The /arquivo/[id] route's load() fetched /v1/archive/{id} on every request and threw archive {id}: 500 when the API had a transient Postgres outage (P2037 pool exhaustion). instrumentation.ts reported every thrown error to errors.bitreport.pt, creating an error loop.
Return null from load() on 5xx instead of throwing, mirroring the BIT-33541 pattern. ArchiveFrame renders a minimal 'temporarily unavailable' shell, and all generateMetadata callers return a default title when info is null. 404/400 still call notFound() as before.
Files changed
apps/site/src/app/arquivo/[id]/load.ts — return null on 5xx
apps/site/src/app/arquivo/[id]/frame.tsx — render fallback shell when load() returns null
apps/site/src/app/arquivo/[id]/page.tsx — handle null in generateMetadata
apps/site/src/app/arquivo/[id]/p/[personId]/page.tsx — same
apps/site/src/app/arquivo/[id]/g/[folderId]/page.tsx — same
apps/site/src/app/arquivo/[id]/f/[faceId]/page.tsx — same
## Fix
The `/arquivo/[id]` route's `load()` fetched `/v1/archive/{id}` on every request and threw `archive {id}: 500` when the API had a transient Postgres outage (P2037 pool exhaustion). `instrumentation.ts` reported every thrown error to `errors.bitreport.pt`, creating an error loop.
Return `null` from `load()` on 5xx instead of throwing, mirroring the BIT-33541 pattern. `ArchiveFrame` renders a minimal 'temporarily unavailable' shell, and all `generateMetadata` callers return a default title when `info` is `null`. 404/400 still call `notFound()` as before.
## Files changed
- `apps/site/src/app/arquivo/[id]/load.ts` — return `null` on 5xx
- `apps/site/src/app/arquivo/[id]/frame.tsx` — render fallback shell when `load()` returns `null`
- `apps/site/src/app/arquivo/[id]/page.tsx` — handle `null` in `generateMetadata`
- `apps/site/src/app/arquivo/[id]/p/[personId]/page.tsx` — same
- `apps/site/src/app/arquivo/[id]/g/[folderId]/page.tsx` — same
- `apps/site/src/app/arquivo/[id]/f/[faceId]/page.tsx` — same
- `apps/site/src/app/arquivo/[id]/load.test.ts` — new tests (6 cases: 200, 500, 502, 503, 404, 400)
## Tests
```
Test Files 3 passed (3)
Tests 10 passed (10)
```
Paperclip-Issue: BIT-33540
The /arquivo/[id] route's load() fetched /v1/archive/{id} on every
request and threw 'archive {id}: 500' when the API had a transient
Postgres outage (P2037 pool exhaustion). instrumentation.ts reported
every thrown error to errors.bitreport.pt, creating an error loop.
Return null from load() on 5xx instead of throwing, mirroring the
BIT-33541 pattern. ArchiveFrame renders a minimal 'temporarily
unavailable' shell, and all generateMetadata callers return a default
title when info is null. 404/400 still call notFound() as before.
Paperclip-Issue: BIT-33540
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.
Fix
The
/arquivo/[id]route'sload()fetched/v1/archive/{id}on every request and threwarchive {id}: 500when the API had a transient Postgres outage (P2037 pool exhaustion).instrumentation.tsreported every thrown error toerrors.bitreport.pt, creating an error loop.Return
nullfromload()on 5xx instead of throwing, mirroring the BIT-33541 pattern.ArchiveFramerenders a minimal 'temporarily unavailable' shell, and allgenerateMetadatacallers return a default title wheninfoisnull. 404/400 still callnotFound()as before.Files changed
apps/site/src/app/arquivo/[id]/load.ts— returnnullon 5xxapps/site/src/app/arquivo/[id]/frame.tsx— render fallback shell whenload()returnsnullapps/site/src/app/arquivo/[id]/page.tsx— handlenullingenerateMetadataapps/site/src/app/arquivo/[id]/p/[personId]/page.tsx— sameapps/site/src/app/arquivo/[id]/g/[folderId]/page.tsx— sameapps/site/src/app/arquivo/[id]/f/[faceId]/page.tsx— sameapps/site/src/app/arquivo/[id]/load.test.ts— new tests (6 cases: 200, 500, 502, 503, 404, 400)Tests
Paperclip-Issue: BIT-33540
The /arquivo/[id] route's load() fetched /v1/archive/{id} on every request and threw 'archive {id}: 500' when the API had a transient Postgres outage (P2037 pool exhaustion). instrumentation.ts reported every thrown error to errors.bitreport.pt, creating an error loop. Return null from load() on 5xx instead of throwing, mirroring the BIT-33541 pattern. ArchiveFrame renders a minimal 'temporarily unavailable' shell, and all generateMetadata callers return a default title when info is null. 404/400 still call notFound() as before. Paperclip-Issue: BIT-33540auto-approve: CI success on
4092e194a9(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
4092e194a9(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
4092e194a9(gitea_auto_approve_open_prs_once.py)