Compare commits

...
2 changed files with 22 additions and 5 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "worldwideview",
"version": "1.19.2",
"version": "1.19.4",
"private": true,
"scripts": {
"setup": "node scripts/setup.mjs",
+21 -4
View File
@@ -11,6 +11,7 @@ import { getVerifiedPluginIds } from "@/lib/marketplace/registryClient";
import { isDemo, isDemoAdmin } from "@/core/edition";
import { auth } from "@/lib/auth";
import { seedDefaultPlugins } from "@/lib/marketplace/seedDefaultPlugins";
import * as Sentry from "@sentry/nextjs";
export async function OPTIONS(request: Request) {
return handlePreflight(request);
@@ -82,20 +83,36 @@ export async function GET(request: Request) {
if (!m) return false;
// Skip built-in plugins — already registered by AppShell
if (m.trust === "built-in") return false;
// Skip stale/malformed records (e.g. old empty-config installs for built-ins)
// If it lacks basic required fields, it's a legacy record and we drop it silently
// to avoid log spam on every poll.
if (!m.entry || !m.name || !m.version) return false;
// Skip bundle plugins whose entry is a bare module specifier
// (e.g. "camera") — cannot be dynamically imported in the browser.
// These are stale/malformed DB records from built-in plugins.
if (
m.format === "bundle" &&
m.entry &&
!m.entry.startsWith("/") &&
!m.entry.startsWith("./") &&
!m.entry.startsWith("http")
) return false;
// Skip records with no usable manifest (e.g. old empty-config installs)
// For anything that looks like a real manifest, validate it and log if it fails
const validation = validateManifest(m);
if (!validation.valid) {
console.error(`[Marketplace API] Manifest validation failed for ${m.id}:`, validation.errors);
const errorMessage = `Manifest validation failed for ${m.id}`;
console.error(`[Marketplace API] ${errorMessage}:`, validation.errors);
// Capture in Sentry so we have visibility into malformed third-party plugins
Sentry.captureMessage(errorMessage, {
level: "error",
extra: {
pluginId: m.id,
validationErrors: validation.errors,
manifest: m
}
});
}
return validation.valid;
})