Skip to content

fix(1.3.1): grouping dedup + web project refresh + delete cascade#35

Merged
RealZST merged 3 commits intomainfrom
fix/extension-grouping-pack-mismatch
May 1, 2026
Merged

fix(1.3.1): grouping dedup + web project refresh + delete cascade#35
RealZST merged 3 commits intomainfrom
fix/extension-grouping-pack-mismatch

Conversation

@RealZST
Copy link
Copy Markdown
Owner

@RealZST RealZST commented May 1, 2026

Summary

Three independent bugs surfaced while investigating a 1.3.0 upgrade report. Bundling them as 1.3.1.

Bug A β€” duplicate extension rows

Skills discovered across multiple agents with mixed pack metadata (some carrying owner/repo, others not β€” e.g. agent-bundled symlink copies) formed separate group rows in the UI even though they were the same logical extension.

Fix: Pre-pass in buildGroups indexes URL-based groups by (kind, logical name, scope) and redirects sourceless instances to the unique sibling, with an "ambiguous β†’ don't merge" guard. Also extracts logicalExtensionName and deriveExtensionUrl so the pre-pass and key builder share one resolution chain.

Bug B β€” web mode stale extension list

Web mode has no Tauri extensions-changed event channel, so adding or removing a project left the UI stale until manual refresh.

Fix: project-store triggers scanAndSync (add) / fetch (remove) explicitly. Desktop unchanged β€” it still relies on the event.

Bug C β€” delete_project orphans extensions

delete_project only removed the row from projects, leaving extensions whose scope_json pointed at that project as ghosts in the "All scopes" view.

Fix: Look up the project path before deletion, cascade to extensions in the same call. For users upgrading from pre-1.3.1 builds with existing orphans, sync_extensions runs a one-shot purge of project-scoped rows whose path no longer matches any project.

Test plan

  • npm test β€” 145 frontend tests passing (incl. 2 new grouping tests)
  • cargo test -p hk-core β€” 343 tests passing (incl. 2 new cascade/orphan tests)
  • npm run lint clean, cargo clippy clean
  • Manual: extension count on "All scopes" matches "Global" + project counts (no orphans)
  • Manual: add project β†’ extensions appear immediately in web mode
  • Manual: delete project β†’ extensions removed immediately, no orphans on rescan

RealZST added 3 commits May 1, 2026 21:29
Skills discovered across multiple agents with mixed pack metadata (some
carrying owner/repo, others not β€” e.g. agent-bundled symlink copies)
formed separate group rows in the UI even though they were the same
logical extension. Add a pre-pass that indexes URL-based groups by
(kind, logical name, scope) and redirects sourceless instances to the
unique sibling, with an "ambiguous β†’ don't merge" guard for cases where
multiple distinct developers exist in the same scope.

Also extract `logicalExtensionName` and `deriveExtensionUrl` from
`extensionGroupKey` so the pre-pass and the key builder share one
resolution chain.
Web mode has no Tauri event channel for `extensions-changed`, so the
extension list went stale after a project was added or removed β€”
add: nothing showed up until manual refresh; remove: orphan rows
lingered in the in-memory list. Trigger an explicit scanAndSync (add)
or fetch (remove) from project-store to keep the UI consistent without
adding event-bus infrastructure for one call site.
`delete_project` only removed the row from `projects`, leaving any
extensions whose `scope_json` pointed at that project as ghosts in the
"All scopes" view with no project to filter into. Look up the project
path before deletion and remove its extension rows in the same call.

For users upgrading from pre-1.3.1 builds that already have orphan
rows, run a one-shot purge inside `sync_extensions` that drops
project-scoped extensions whose path no longer matches any project.
@RealZST RealZST merged commit 1d4045b into main May 1, 2026
3 checks passed
@RealZST RealZST deleted the fix/extension-grouping-pack-mismatch branch May 1, 2026 18:42
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