Repository navigation
fix(plugins): refresh connection catalogue after plugin install/remove - #1263
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The wrapper refreshes the connection-catalogue resource (fire-and-forget, Files Reviewed (2 files)
Reviewed by claude-sonnet-5.5 · Input: 252 · Output: 1.5K · Cached: 199.8K Review guidance: REVIEW.md from base branch |
debba
left a comment
There was a problem hiding this comment.
Thanks for tracking this down! Your write-up on why Add Connection keeps its own registry cache, separate from the one Plugin Center uses, made the fix easy to follow. Wrapping refreshRegistry once in PluginsTab means install, uninstall, update and reload are all covered without touching each flow. I also checked that the new test actually fails on main, which is exactly what I want from a regression test.
Approving. A few things that can be follow-ups, none of them blocking:
- Deep link installs (
useDeepLinkInstall.ts) emittabularis://plugin-installed.PluginRegistryProviderrefreshes on that, but nothing refreshes the connection catalogue, so installing a driver through a deep link while Settings is closed can still leave Add Connection stale. Refreshing the catalogue fromPluginRegistryProvider(or from that event listener) would cover every path in one place. - Each wrapped refresh now calls
fetch_plugin_registrytwice, once per cache, so every install/remove/reload does two registry round trips. Fine for now, but the two caches could share one result. - Small thing in the description: it says returning the original refresh result keeps the theme removal "committed but refresh failed" path working, but
PluginRegistryState.refreshis typed() => void, so there's no rejection to pass along. The code is fine, it's only the explanation. - The test is named after installing a driver but goes through the downgrade button. An uninstall case would be nice to have too.
I'll give it a run in the app before merging.
|
I gave this a run in the app and it works, so from my side it's ready to merge. With a fresh profile I opened Add Connection to prime the catalogue, installed CSV from Settings > Plugins, and the card switched to Installed and opened the config form directly. Removing it brought the Install badge back. With main's |
Summary
Fixes Add Connection continuing to show a driver as uninstalled after it has been installed from Settings > Plugins. The connection catalogue is now refreshed whenever Plugin Center installs, updates or removes a plugin.
Closes #1262
Problem
After installing a driver (observed with CSV 1.0.5 on
feat/web-ui) from Plugin Center, Add Connection could still treat it as uninstalled:The backend was correct throughout. The manifest and
fetch_plugin_registryreported 1.0.5,get_registered_driversincludedcsv, andactiveExternalDriverslisted it. Restarting the app fixed the catalogue entry.Root cause
useConnectionCataloguecachesfetch_plugin_registryresults per client and registry URL, in a resource separate from the Plugin Center registry (usePluginRegistry).The install, uninstall and update flows in
PluginsTabrefreshed the Plugin Center registry and the driver store, but never the connection-catalogue resource. If the catalogue had already been loaded (for example by opening Add Connection beforehand), it kept the pre-install registry snapshot, in which the driver hadinstalled_version: null.Changes
packages/web-ui/src/components/settings/PluginsTab.tsxPluginsTabnow readsrefreshfromuseConnectionCatalogue(false). Thefalseargument means the tab only refreshes the cache and does not trigger an initial fetch.refreshRegistrycallback is now a wrapper that refreshes the connection catalogue and then returns the Plugin Center registry's refresh result.packages/web-ui/tests/components/settings/PluginsTab.test.tsxuseConnectionCatalogueand adds a regression test asserting the catalogue refresh runs after a driver install.Demo
Screen.Recording.2026-10-23.at.4.46.22.PM.mov
Testing
Automated:
pnpm --filter ./packages/web-ui exec vitest run tests/components/settings tests/hookspasses (61 files, 456 tests).tsc --noEmitis clean.Manual: