fix(1.3.1): grouping dedup + web project refresh + delete cascade#35
Merged
fix(1.3.1): grouping dedup + web project refresh + delete cascade#35
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
buildGroupsindexes URL-based groups by(kind, logical name, scope)and redirects sourceless instances to the unique sibling, with an "ambiguous β don't merge" guard. Also extractslogicalExtensionNameandderiveExtensionUrlso the pre-pass and key builder share one resolution chain.Bug B β web mode stale extension list
Web mode has no Tauri
extensions-changedevent channel, so adding or removing a project left the UI stale until manual refresh.Fix:
project-storetriggersscanAndSync(add) /fetch(remove) explicitly. Desktop unchanged β it still relies on the event.Bug C β
delete_projectorphans extensionsdelete_projectonly removed the row fromprojects, leaving extensions whosescope_jsonpointed 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_extensionsruns 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 lintclean,cargo clippyclean