Skip to content

fix(extensions): deduplicate dev-linked extensions in discover_all - #1132

Merged
Xoshbin merged 1 commit into
mainfrom
fix/deduplicate-dev-linked-extensions
Nov 27, 2026
Merged

Xoshbin merged 1 commit into
mainfrom
fix/deduplicate-dev-linked-extensions

Conversation

@Xoshbin

@Xoshbin Xoshbin commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

asyar link --dev both symlinks the extension into extensions/ and
registers it in dev_extensions.json. discover_all scanned both
sources into all_records without deduplicating by manifest.id,
returning duplicate records to the frontend and triggering a Svelte
each_key_duplicate crash in ThemePicker when a theme extension
was dev-linked.

Replace any matching manifest.id record via upsert_extension_record
so dev entries override installed/symlinked ones cleanly.

What changed

  • Before (issue / current behavior):
  • After (fix / new behavior):

Affected areas

  • Launcher UI / UX (visuals, interactions, keyboard shortcuts, settings)
  • SDK / Extensions (asyar-sdk, extension runtime, IPC contracts, manifest)
  • Rust Backend / Platform (Tauri commands, search, storage, OS integration)
  • Docs / Tooling / Other (docs, CI, build scripts, locales)

Manual smoke test & Validation

  • I manually smoke-tested this in the running app (pnpm dev) and visually verified the fix/feature works.

AI usage

  • AI tools helped produce this change.
  • I ran the asyar-contribution skill (.agents/skills/asyar-contribution/SKILL.md), followed it, and reviewed every generated line.

Boundaries

  • Zero-hardcoded-strings i18n policy respected (if UI strings were added/changed).
  • Third-party extension compatibility preserved (no breaking changes to published extension contracts without deprecation/boundary adapter).
  • Hot paths remain fast and unblocked (window reveal, keystroke search, and 120 FPS UI responsiveness).
  • pnpm check:ci (or the relevant inner-loop checks) passes locally.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented duplicate extension records when a development extension shares an ID with an installed extension. The development extension now replaces the matching record, while unrelated extensions remain unchanged.

`asyar link --dev` both symlinks the extension into `extensions/` and
registers it in `dev_extensions.json`. `discover_all` scanned both
sources into `all_records` without deduplicating by `manifest.id`,
returning duplicate records to the frontend and triggering a Svelte
`each_key_duplicate` crash in `ThemePicker` when a theme extension
was dev-linked.

Replace any matching `manifest.id` record via `upsert_extension_record`
so dev entries override installed/symlinked ones cleanly.
@github-actions github-actions Bot added the bug Something isn't working label Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Dev extension discovery now upserts records by manifest ID. A test checks that the upsert replaces a matching installed record and preserves an unrelated record.

Changes

Dev extension record upsert

Layer / File(s) Summary
Upsert dev extension records
asyar-launcher/src-tauri/src/extensions/lifecycle.rs
A private helper removes records with the incoming manifest ID before adding the new record. Dev extension discovery uses the helper. A test checks replacement, preservation of an unrelated record, and the resulting dev path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: ysielx

Merge Risk: Minimal · up to 17142

Dev-linked extensions should no longer appear twice, which removes the duplicate-key crash in the theme picker. The remaining edge case needs a developer to deliberately give a dev extension a built-in ID, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix (deduplicating dev-linked extensions in discover_all). The raw summary says discover_all now upserts dev extension records by manifest ID, replacing existing records instead of…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix (deduplicating dev-linked extensions in discover_all). The raw summary says discover_all now upserts dev extension records by manifest ID, replacing existing records instead of appending duplicates, and a test covers this. The title matches the main change and the stated objective of PR #1132, so it passes. It uses the conventional commit prefix, which is consistent with the project's style.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 545970f and 171421d.

Files selected for processing: 1

  • asyar-launcher/src-tauri/src/extensions/lifecycle.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@Xoshbin
Xoshbin merged commit 3a038b2 into main Nov 27, 2026
14 checks passed
@Xoshbin
Xoshbin deleted the fix/deduplicate-dev-linked-extensions branch November 27, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant