fix(desktop,trpc,cli): stop the Google Calendar Connect loop and make plugins public

HA
1mo ago
+220-7

Problem

Connecting Google Calendar succeeds in OAuth but the desktop ends up on the Connect dialog again, every time. Root-cause write-up: https://app.superset.sh/page/google-calendar-plugin-why-connect-loops-154e04

Changes

  • plugins.list: an installed first-party plugin (Gmail) no longer hides the shared google connection from a sibling plugin (Google Calendar). Only third-party installs claim a connector. Without this, connections was [], so Install reopened the dialog and useInstallAfterConnect never installed.
  • Deep links: superset://plugins/x?connected=1 lost its query string because TanStack Router does not parse ? in to/href. New parseDeepLinkPath splits path and search, so the connected toast and ?error= toasts fire.
  • Connect dialog: closes when the ?connected= outcome arrives, so re-authorizing an account you already have no longer leaves it open.
  • CLI: superset plugins is no longer audience: "internal", so it shows without SUPERSET_CLI_AUDIENCE=internal (the only workaround for this loop). Added to cli-reference.mdx, as apps/docs/AGENTS.md requires. mcp and skills stay internal; all plugins subcommands, including the authoring ones, become public.

Not changed: routing deep-link logs through electron-log.

Validation

Ran in the real desktop app from this branch (local stack: Postgres 18, API, Electron, driven over CDP). The Google consent screen was not driven: a google connection row with the calendar scopes stands in for a finished OAuth, and the deep link is sent with open -a.

JourneyBase codeThis branch
Gmail installed, live google connection, Calendar → Install pluginConnect dialog opens, nothing installedInstalls, "Google Calendar installed" toast, plugin_installs row
Deep link …/plugins/google-calendar?connected=1Not run on base"Connected Google Calendar" toast; installs a not-yet-installed plugin
Deep link …?error=oauth_deniedNot run on base"You declined the Google Calendar authorization request." toast
Dialog open on an installed plugin, then the connected deep linkNot run on baseDialog closes

Also: new parseDeepLinkPath tests (3) and the plugins.list regression test pass (fails on the base code); biome clean on the changed files. For the CLI change, bun test in packages/cli (438 pass) and packages/cli-framework (76 pass), and the schema lists plugins without the env var.

Not done: a real Google consent round trip, and typecheck is not clean repo-wide (existing better-auth type errors in packages/trpc; none in the changed files).

Review notes

The page suggested dropping the connector-claim exclusion entirely. I kept it for third-party installs because plugins.test.ts ("a connection another install claims stays on that install only") relies on it.

Summary by CodeRabbit

  • New Features

    • Added a comprehensive plugins CLI command group for installing, connecting, enabling, disabling, syncing, validating, publishing, and managing plugin marketplaces.
    • Deep links now preserve destination paths and query parameters, including authentication error details.
  • Bug Fixes

    • Plugin connection dialogs now close automatically after a successful connection.
    • Shared connections remain available across compatible first-party plugins without being incorrectly blocked.

Summary by cubic

Fixes the Google Calendar connect loop so OAuth completes without reopening the Connect dialog, and makes superset plugins available without an internal audience flag.

Bug Fixes

  • Only third-party installs claim a connector, so Gmail no longer hides shared Google connections from Google Calendar.
  • Deep links now split path and query string, so ?connected= and ?error= outcomes reach the plugin page.
  • The Connect dialog closes when a connected outcome arrives, including for re-authorization of an existing account.

CLI

  • superset plugins is now public (removed audience: "internal") and documented in the CLI reference.