fix: answer 503 for plugin lists and marketplace installs while the shared store is down #1066

directory-keys-shared.test.ts: the store-down case now expects the store error instead of an 'invalid' signature, since a store outage no longer counts as a bad signature.
This commit is contained in:
Linus Rath
2026-11-01 01:03:13 +01:00
parent d78ce02f78
commit 38bc06f2d3
7 changed files with 34 additions and 2 deletions
+3
View File
@@ -2,6 +2,7 @@ import { NextRequest, NextResponse } from 'next/server';
import { requireAdminAuth, getClientIP } from '@/lib/admin/session';
import { auditLog } from '@/lib/admin/audit';
import { logger } from '@/lib/logger';
import { storeUnavailableResponse } from '@/lib/admin/store-unavailable-response';
import {
getPlugin,
getPluginRegistry,
@@ -46,6 +47,8 @@ export async function GET(request: NextRequest) {
headers: { 'Cache-Control': 'no-store' },
});
} catch (error) {
const unavailable = storeUnavailableResponse(error);
if (unavailable) return unavailable;
logger.error('Plugin list error', { error: error instanceof Error ? error.message : 'Unknown error' });
return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}