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
@@ -4,6 +4,7 @@ import { getPluginRegistry, getThemeRegistry } from '@/lib/admin/plugin-registry
import { listDevPlugins } from '@/lib/admin/plugin-dev';
import { configManager } from '@/lib/admin/config-manager';
import { logger } from '@/lib/logger';
import { storeUnavailableResponse } from '@/lib/admin/store-unavailable-response';
import { isNoThirdPartyTrafficOn } from '@/lib/admin/third-party-mode';
import { pluginDeclaresNetwork } from '@/lib/outgoing-hosts';
@@ -98,6 +99,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 });
}