From e9987b40e6b867683452516842d42530abcf5b85 Mon Sep 17 00:00:00 2001 From: argusagent Date: Tue, 17 Mar 2026 20:27:04 -0400 Subject: [PATCH] =?UTF-8?q?fix(share):=20wire=20assertShareDbReady=20into?= =?UTF-8?q?=20router=20middleware=20=E2=80=94=20address=20code=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/server/src/share/routes.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/server/src/share/routes.ts b/apps/server/src/share/routes.ts index 6c41d368de..6494f099a7 100644 --- a/apps/server/src/share/routes.ts +++ b/apps/server/src/share/routes.ts @@ -123,6 +123,13 @@ function render404(res: Response) { } function register(router: Router) { + // Guard: if the share DB is not yet initialized, return 503 for all /share routes. + router.use((_req: Request, res: Response, next) => { + if (!assertShareDbReady(res)) { + return; + } + next(); + }); function renderNote(note: SNote, req: Request, res: Response) { if (!note) {