Summary
attachAuth swallows DB errors from isMaster / getCompanyId into isMaster=false / companyId=-1, which downstream handlers treat as auth failure (403). Operators may misread a Postgres outage as invalid API keys.
Proposed fix
Surface infrastructure failures as 503 when auth lookups fail due to DB errors (called out as possible future fix in auth.js comments).
Acceptance criteria
Source
Code review backlog (2026-06-23)
Summary
attachAuthswallows DB errors fromisMaster/getCompanyIdintoisMaster=false/companyId=-1, which downstream handlers treat as auth failure (403). Operators may misread a Postgres outage as invalid API keys.Proposed fix
Surface infrastructure failures as 503 when auth lookups fail due to DB errors (called out as possible future fix in
auth.jscomments).Acceptance criteria
Source
Code review backlog (2026-06-23)