Skip to content

feat(plugins): update flow — detection, one-click update, permission re-consent (#52)#61

Merged
kipavy merged 2 commits into
devfrom
feat/plugin-update-flow-52
Jul 24, 2026
Merged

feat(plugins): update flow — detection, one-click update, permission re-consent (#52)#61
kipavy merged 2 commits into
devfrom
feat/plugin-update-flow-52

Conversation

@kipavy

@kipavy kipavy commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Closes #52. The plugin manager had no update mechanism (uninstall + reinstall only), no update-available detection, and no re-consent when a plugin's permissions or code change. installPlugin already overwrites → hash-verifies (#44) → reloads, so this adds the missing detection, affordance, and consent around it. No Rust changes.

What's here

  • src/plugins/updates.ts (pure, unit-tested): compareSemver, availableUpdate (newer version OR versionless hash-diff — catches in-repo re-stamps like navy-green on mutable main), addedPermissions.
  • Detection UI in both tabs: Installed shows v{old} → {new} + an Update button; Browse swaps the Installed badge for an Update button; the Installed tab header shows a • N updates count. Catalog is fetched once on section mount.
  • Consent (per maintainer decision):
    • First installs show a permission disclosure, gated by a new default-on setting "Review permissions before installing plugins" (opt-out).
    • Updates apply silently unless they request a NEW permission, which always prompts (non-skippable security gate — not covered by the setting).
    • Shared PluginPermissionModal for both (install = all perms; update = added perms emphasized).
  • marketplaceStore.fetchManifest for the pre-consent permission preview.
  • i18n en/fr/ru parity.

Verification

  • updates.ts unit tests (15) + full suite 868 passing, tsc clean, i18n parity green.
  • Live (headless WebDriver): install disclosure (title/body/themes badge) → confirm installs (6→7); update detection (• 1 update count, v0.9.0 → 1.0.0 arrow, Update button); silent update when no new perms (badge clears); permission-grow modal ("New permissions" + themes) as the security gate; opt-out OFF → one-click install with no disclosure.

Notes / out of scope

kipavy added 2 commits July 24, 2026 09:43
…re-consent (#52)

The plugin manager had no update mechanism (uninstall+reinstall only) and no
re-consent when a plugin's permissions or code change. installPlugin already
overwrites + hash-verifies + reloads, so this adds the missing detection,
affordance, and consent around it.

- updates.ts: pure detection (compareSemver, availableUpdate by version OR
  versionless hash-diff, addedPermissions) + unit tests.
- Update affordance in BOTH tabs: Installed shows v{old} → {new} + Update
  button; Browse swaps the badge for Update; Installed tab header shows a
  '• N updates' count. Catalog is fetched once on section mount.
- Consent: first installs show a permission disclosure (gated by a new
  default-on 'Review permissions before installing plugins' setting); updates
  apply silently unless they request NEW permissions, which always prompts
  (non-skippable). Shared PluginPermissionModal for both.
- marketplaceStore.fetchManifest for the pre-consent permission preview.
- i18n en/fr/ru parity.
…pdates (#52)

- Security: pass the reviewed manifest text into installPlugin so the executed
  permission set is exactly the consented one, closing the fetch→consent→load
  TOCTOU (manifest.json isn't hash-pinned; index.js still is). Covers install
  disclosure, silent updates, and permission-grow updates.
- availableUpdate now requires an exact sourceId match — a local/url plugin is
  never 'updated' from an id-colliding catalog entry (which would overwrite the
  local bundle). +2 regression tests.
- Installed-tab update perm baseline reads getLoadedPlugins() at click, matching
  the Browse tab.
- Backfill 3 ru keys missing since #44 (install.failed/integrityFailed,
  installed.unverified).
@kipavy
kipavy merged commit 199878b into dev Jul 24, 2026
1 check passed
@kipavy
kipavy deleted the feat/plugin-update-flow-52 branch July 24, 2026 10:07
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.

1 participant