Problem
MpakSource caches its searchServers result at module scope with a 5-minute TTL (src/registries/mpak-source.ts:CACHE_TTL_MS). When an operator flips a registry's enabled flag or changes scopes via the admin UI, Browse can show stale results for up to 5 minutes — confusing and feels broken.
Fix
After RegistryStore.update() returns, call _resetMpakSourceCache() so the next getConnectorDirectory().list() re-fetches.
The simplest place to wire this is in the admin tool that handles registry mutations (likely manage_registries.update_registry or wherever runtime.getRegistryStore().update() is called). One line per call site, or better: have RegistryStore.update() invoke a registered callback.
Cleanest pattern:
MpakSource registers a hook on the store at module load.
RegistryStore.update() fires the hook after a successful write.
- Hook calls
_resetMpakSourceCache().
Same pattern would let other source types invalidate caches without coupling.
Surfaced by
QA review of #195 (Suggestion #3).
Problem
MpakSourcecaches itssearchServersresult at module scope with a 5-minute TTL (src/registries/mpak-source.ts:CACHE_TTL_MS). When an operator flips a registry'senabledflag or changesscopesvia the admin UI, Browse can show stale results for up to 5 minutes — confusing and feels broken.Fix
After
RegistryStore.update()returns, call_resetMpakSourceCache()so the nextgetConnectorDirectory().list()re-fetches.The simplest place to wire this is in the admin tool that handles registry mutations (likely
manage_registries.update_registryor whereverruntime.getRegistryStore().update()is called). One line per call site, or better: haveRegistryStore.update()invoke a registered callback.Cleanest pattern:
MpakSourceregisters a hook on the store at module load.RegistryStore.update()fires the hook after a successful write._resetMpakSourceCache().Same pattern would let other source types invalidate caches without coupling.
Surfaced by
QA review of #195 (Suggestion #3).