Fix cross-repo inbound deeplinks and iOS HTTPS send-to-Mac#383
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Block createLaneFromPrBranch when the requested GitHub repo does not match the active project's origin remote, preventing lane imports into the wrong checkout when a deeplink targets another repository. Accept https://ade.app/open URLs in sync deeplinks.open (iOS Send to Mac) by validating with parseDeeplink instead of requiring ade:// only. Clear local runtime client state when an owned child process exits. Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
d24cbdf to
418fc50
Compare
|
@copilot review but do not make fixes |
There was a problem hiding this comment.
PR Review
Scope: 7 file(s), +250 / −12
Verdict: Looks good
This PR fixes cross-repo inbound deeplinks and iOS “Send to Mac” by accepting validated https://ade.app/open URLs over sync, blocks createLaneFromPrBranch when the deeplink repo does not match the active project’s GitHub remote, and clears local-runtime client state only when the exiting child is still the pool’s owned runtime.
Notes
- Deeplink validation:
deeplinks.opennow uses sharedparseDeeplink, which allowlistsade.app, enforces/open, and validates target shape before dispatch — a tighter boundary than the previousade://-only check and a good reuse of existing parser tests. - Cross-repo lane guard:
project_repo_mismatchis enforced inbuildCreateLaneFromPrBranchPreflightand therefore applies to both preflight andcreateLaneFromPrBranch(canCreate: false→ throw). UI surfaces viablockingConflict.messageinInboundDeeplinkModal/GitHubTab. - Runtime cleanup:
ownedRuntimeChildidentity guard correctly prevents a superseded spawn’sexithandler from wiping a replacement connection; tests cover both stale-clear and no-clear paths. - Intentional gap (unchanged): When
githubService.getRepoOrThrow()fails,projectRepostaysnulland the repo-mismatch block is skipped — same as pre-PR behavior for projects without a resolvable GitHub remote; navigation UX still relies onCrossRepoPrBannerfor the view-only case.
Sent by Cursor Automation: BUGBOT in Versic
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
@copilot review but do not make fixes |


Bug and impact
Wrong-project lane creation from inbound branch/PR deeplinks
When multiple projects are open, OS-routed deeplinks (
ade:/// second-instance) dispatch to the focused window.InboundDeeplinkModalcan create a lane from a PR in repo A while the active project’soriginpoints at repo B. If the wrong checkout has a colliding branch name onorigin, preflight could pass and import the wrong branch into the wrong workspace.iOS “Send to Mac” broken for HTTPS open links
iOS forwards both
ade://andhttps://ade.app/open?...URLs, butdeeplinks.openrejected non-ade:protocols. Users saw “Sent” on iOS while desktop never navigated.Local runtime stale connection after child exit
When an app-owned
ade servechild exited without a socket disconnect callback,activeClientandprojectsByRootwere left populated whileconnectionwas cleared, so status could read “connected” while RPC failed.Root cause
createLaneFromPrBranchpreflight fetched PR metadata for the deeplink repo but ran git checks against the activeprojectRootwithout verifying the project’s GitHub remote matched.syncRemoteCommandServiceused a rawURL.protocol === "ade:"gate instead of sharedparseDeeplink(which already accepts HTTPS open URLs).localRuntimeConnectionPoolchildexithandler only nulledconnection.Fix and validation
project_repo_mismatchwhengetRepoOrThrow()disagrees with explicit deeplink repo args.deeplinks.openURLs viaparseDeeplink; pass the original URL through to desktop dispatch.activeClientandprojectsByRooton owned-child exit/error.prService.createLaneFromPrBranchcross-repo block case; existing pool tests pass.npm run typecheckinapps/desktopandapps/ade-cli.Greptile Summary
This PR fixes three independent bugs: a cross-repo lane import guard, iOS HTTPS deeplink support, and stale connection state after a child-process exit. The fixes are self-contained and well-tested.
prService.ts,prs.ts):buildCreateLaneFromPrBranchPreflightnow callsgetRepoOrThrow()before fetching PR data and returns aproject_repo_mismatchblock when the deeplink's owner/repo differs from the active project's GitHub remote; case-insensitive comparison prevents false positives on GitHub's case-preserving but case-insensitive namespace.syncRemoteCommandService.ts): The rawURL.protocol === \"ade:\"gate is replaced withparseDeeplink, and the original URL string is forwarded todispatchDeeplinkUrlrather than a canonicalized.toString(), preserving HTTPS form for downstream handlers.localRuntimeConnectionPool.ts): A newownedRuntimeChildfield tracks the currently-ownedChildProcess; the newclearCurrentChildStateclosure guards against superseded-child exits by identity-checking againstchild, then atomically nullsconnection/activeClient/ownedRuntimeChild, clearsprojectsByRoot, and callscloseRuntimeClient.Confidence Score: 5/5
Safe to merge — all three fixes are narrowly scoped, identity-guarded against state races, and backed by new integration tests.
The cross-repo guard short-circuits before any network call and falls back gracefully when the project remote is unresolvable. The ownedRuntimeChild identity check in clearCurrentChildState correctly prevents a superseded child exit from wiping a live replacement connection, and closeRuntimeClient wraps client.close() in try/catch so the event handler cannot throw into Node uncaught-exception path. The deeplink URL validation delegates to the already-tested parseDeeplink shared parser, and the original URL string is forwarded rather than a canonicalized form. No pre-existing contracts are broken.
No files require special attention.
Important Files Changed
Reviews (2): Last reviewed commit: "fix: address review cleanup details" | Re-trigger Greptile