fix(capabilities): stop caching the catalog source per module copy (#4351)
This commit is contained in:
@@ -484,7 +484,8 @@ const MODALITY_KEYS = ["vision", "pdf", "audioInput", "videoInput"];
|
||||
// The server bundles this module into every route chunk that needs it, and each
|
||||
// copy carries its own module state, so an install landing in the copy the
|
||||
// startup hook imported stays invisible to the copy resolving requests. The slot
|
||||
// lives on globalThis instead; the local binding is the fast path.
|
||||
// lives on globalThis instead, and every read goes through it: caching it locally
|
||||
// would keep a reader alive in other copies after setCatalogSource(null).
|
||||
let catalogSource = null;
|
||||
|
||||
/**
|
||||
@@ -498,9 +499,8 @@ export function setCatalogSource(source) {
|
||||
}
|
||||
|
||||
function getCatalogSource() {
|
||||
if (catalogSource) return catalogSource;
|
||||
if (typeof globalThis === "undefined") return null;
|
||||
return (catalogSource = globalThis.__9rCatalogSource || null);
|
||||
if (typeof globalThis === "undefined") return catalogSource;
|
||||
return globalThis.__9rCatalogSource || null;
|
||||
}
|
||||
|
||||
// Apply the synced catalog + name heuristic on top of a table-resolved result.
|
||||
|
||||
Reference in New Issue
Block a user