Skip to content

fix(plugins): refresh connection catalogue after plugin install/remove - #1263

Merged
debba merged 1 commit into
TabularisDB:mainfrom
Asymtode712:fix/connection-catalogue-refresh
Oct 23, 2026
Merged

debba merged 1 commit into
TabularisDB:mainfrom
Asymtode712:fix/connection-catalogue-refresh

Conversation

@Asymtode712

@Asymtode712 Asymtode712 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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 catalogue showed an Install badge for the driver.
  • Selecting it displayed "This driver isn't installed yet. Install it to configure a connection."
  • The configuration step stayed blocked behind an Install v1.0.5 button.

The backend was correct throughout. The manifest and fetch_plugin_registry reported 1.0.5, get_registered_drivers included csv, and activeExternalDrivers listed it. Restarting the app fixed the catalogue entry.

Root cause

useConnectionCatalogue caches fetch_plugin_registry results per client and registry URL, in a resource separate from the Plugin Center registry (usePluginRegistry).

The install, uninstall and update flows in PluginsTab refreshed 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 had installed_version: null.

Changes

  • packages/web-ui/src/components/settings/PluginsTab.tsx
    • PluginsTab now reads refresh from useConnectionCatalogue(false). The false argument means the tab only refreshes the cache and does not trigger an initial fetch.
    • The refreshRegistry callback is now a wrapper that refreshes the connection catalogue and then returns the Plugin Center registry's refresh result.
    • Every existing call site goes through the wrapper, so driver install, theme install and uninstall, driver uninstall and updates are all covered with no further changes.
    • Returning the original refresh result keeps the existing error handling intact. For example, the theme-removal "committed but refresh failed" path still sees the rejection.
  • packages/web-ui/tests/components/settings/PluginsTab.test.tsx
    • Mocks useConnectionCatalogue and 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/hooks passes (61 files, 456 tests).
  • tsc --noEmit is clean.

Manual:

  1. Start the desktop app with CSV uninstalled.
  2. Open Connections > Add Connection so the catalogue loads, then close it.
  3. Open Settings > Plugins and install CSV.
  4. Return to Add Connection and select CSV. Expected: it shows as installed and opens the configuration form, with no restart and no second install.
  5. Uninstall CSV in Plugin Center and reopen Add Connection. Expected: the Install badge is back.

@kilo-code-bot

kilo-code-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The wrapper refreshes the connection-catalogue resource (fire-and-forget, enabled=false so no extra initial fetch) and returns the Plugin Center registry's refresh result, preserving existing error handling at all refreshRegistry call sites. The regression test covers the install/downgrade path.

Files Reviewed (2 files)
  • packages/web-ui/src/components/settings/PluginsTab.tsx
  • packages/web-ui/tests/components/settings/PluginsTab.test.tsx

Reviewed by claude-sonnet-5.5 · Input: 252 · Output: 1.5K · Cached: 199.8K

Review guidance: REVIEW.md from base branch main

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) emit tabularis://plugin-installed. PluginRegistryProvider refreshes 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 from PluginRegistryProvider (or from that event listener) would cover every path in one place.
  • Each wrapped refresh now calls fetch_plugin_registry twice, 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.refresh is 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.

@debba

debba commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

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 PluginsTab the same steps leave CSV on Install. No console errors along the way.

@debba
debba merged commit 64cea13 into TabularisDB:main Oct 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Add Connection still shows a driver as uninstalled after installing it in Plugin Center

2 participants