fix(gateway): invalidate channel caches on re-pin

This commit is contained in:
Ayaan Zaidi
2026-03-25 09:24:46 +05:30
committed by Peter Steinberger
parent fae4492d92
commit ef5e554def
2 changed files with 35 additions and 1 deletions

View File

@@ -106,16 +106,25 @@ export function resolveActivePluginHttpRouteRegistry(fallback: PluginRegistry):
* gateway startup after the initial plugin load so that config-schema reads
* and other non-primary registry loads cannot evict channel plugins. */
export function pinActivePluginChannelRegistry(registry: PluginRegistry) {
if (state.channelRegistry === registry && state.channelRegistryPinned) {
return;
}
state.channelRegistry = registry;
state.channelRegistryPinned = true;
state.version += 1;
}
export function releasePinnedPluginChannelRegistry(registry?: PluginRegistry) {
if (registry && state.channelRegistry !== registry) {
return;
}
const nextChannelRegistry = state.registry;
if (state.channelRegistry === nextChannelRegistry && !state.channelRegistryPinned) {
return;
}
state.channelRegistryPinned = false;
state.channelRegistry = state.registry;
state.channelRegistry = nextChannelRegistry;
state.version += 1;
}
/** Return the registry that should be used for channel plugin resolution.