Skip to content

fix(desktop): fix dev protocol plist patching to prevent deep link collisions#1445

Merged
saddlepaddle merged 1 commit into
mainfrom
fix/lsregister-deduping
Feb 12, 2026
Merged

fix(desktop): fix dev protocol plist patching to prevent deep link collisions#1445
saddlepaddle merged 1 commit into
mainfrom
fix/lsregister-deduping

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Feb 12, 2026

Summary

  • Fixed patch-dev-protocol.ts leaving Electron.app with default com.github.Electron bundle ID, causing macOS Launch Services to treat all dev worktrees as the same app
  • PlistBuddy Add commands now delete existing CFBundleURLTypes first, preventing stale/duplicate URL scheme entries from accumulating across dev sessions
  • "Already patched" check now validates both bundle ID and scheme, catching partial-reset states (e.g., after bun install wipes the plist)

Test plan

  • Run bun dev in two worktrees with different SUPERSET_WORKSPACE_NAME values
  • Verify each prints Registering superset-{workspace}:// scheme... with its own workspace name
  • Auth in the second worktree — deep link should route to the correct instance
  • Run bun dev again in both — verify already registered message (idempotency)

Summary by CodeRabbit

  • Bug Fixes

    • Fixed protocol scheme registration validation in development builds to handle multi-workspace setups correctly.
    • Prevented duplicate protocol scheme entries in development environment configuration.
    • Strengthened error handling to catch configuration issues earlier.
  • Chores

    • Improved development patch process for better workspace isolation.

…llisions

The patch-dev-protocol script had bugs that left Electron.app with the
default com.github.Electron bundle ID, causing macOS Launch Services to
treat all dev worktrees as the same app and route deep links to the wrong
instance.

- Delete existing CFBundleURLTypes before re-adding to prevent stale/duplicate entries
- Validate both bundle ID and scheme in "already patched" check
- Stop swallowing errors on PlistBuddy commands so failures surface
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Updates macOS protocol patch script to validate existing bundle identifier and URL schemes before patching. Introduces workspace-aware validation and multi-worktree isolation by setting unique bundle IDs and cleaning stale URL type entries before adding fresh protocol scheme registrations.

Changes

Cohort / File(s) Summary
Patch Script Enhancement
apps/desktop/scripts/patch-dev-protocol.ts
Adds workspace-aware validation to check existing CFBundleIdentifier and CFBundleURLSchemes before patching; introduces dual-step patch flow with unique bundle ID assignment and explicit URL type deletion to prevent duplicates; removes error-tolerant guards around plist commands to propagate failures.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • superset-sh/superset#50: Related deep-link and protocol registration enhancement for CFBundleIdentifier and CFBundleURLSchemes configuration in desktop builds.

Poem

🐰 The rabbit patches with workspace care,
Validating bundles everywhere!
Stale schemes? Deleted, made anew,
Multi-worktree isolation, too! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/lsregister-deduping

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@saddlepaddle saddlepaddle merged commit e71fffa into main Feb 12, 2026
4 of 6 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app
  • ⚠️ Streams Fly.io app

Thank you for your contribution! 🎉

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