Repository navigation
Conversation
Contributor
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — This PR changes Windows protocol registration used to deliver OAuth callbacks in unpackaged builds, with focused tests for the affected boundaries. Because it modifies authentication-related runtime behavior, human review is warranted despite the limited scope. You can add or adjust custom eligibility rules. Learn more. |
Contributor
This branch has not been deployed
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.
Windows browser OAuth callbacks in unpackaged production builds launch bare Electron with the callback URL as its app path, producing “Unable to find Electron app.” Register the scheme after Clerk initializes with the running executable and absolute
dist-electron/main.cjs. Development and packaged builds remain excluded.Restores #15995 after the batch rollback in #22222, following the request for a fresh PR with real desktop evidence. Cherry-picks the original fix, development exclusion and boundary tests, preserving author attribution and current main's early single-instance locking.
Windows production runtime proof
Tested on Windows 11 Pro x64 (26200), Electron 44.4.5, against baseline
dac3437d94and this branch's51f255299a. Built the full app withvp run build:desktop; after applying the fix, rebuilt the production desktop bundles withvp pack, reusing the unchanged server/web artifacts. Both runs used the actual built desktop window and local backend, withoutVITE_DEV_SERVER_URL.The sandbox started with existing Windows state copied from the installed app: Electron profile, desktop/client preferences, keybindings, and a read-only database snapshot containing 3 projects, 9 stopped/settled threads, 304 messages and 5,116 events. Live/recoverable work, scheduled tasks and pending effects were excluded. Existing settled threads appeared in the native production window before and after the fix; the Browser panel also loaded the sandbox's production client successfully.
Before, real Windows registration omitted the entry point (paths abbreviated):
The invocation used the registered executable with a diagnostic
--requiremodule that captured Electron's native error dialog instead of blocking on it.After, the same real build and copied state registered and delivered the callback through Windows:
A diagnostic observer used the real Clerk IPC transport and actual main-window WebContents. Only the outgoing synthetic HTTPS authorization launch was suppressed; callback registration, Windows shell dispatch, secondary-process launch, single-instance forwarding and Clerk resolution used the real production runtime. This initial check verified synthetic callback transport.
Manual real sign-in also passed: @AskPlays subsequently completed browser sign-in from the built desktop app and confirmed that sign-in worked. Runtime diagnostics recorded the browser callback reaching the existing primary desktop process (PID 52492), with no renderer failure. The manual run used the same copied existing state. A diagnostic prelude pinned only the sandbox home/profile environment for browser-launched callback processes; production OAuth and protocol-registration logic were unchanged. Callback parameters were redacted from diagnostics.
After both runs, project/thread/message/event counts were unchanged and the SHA256 of all message projection rows matched the pre-run snapshot (
70dd258fc3047032a39293346c41544e51b528f0226217ca1ddacea286b27d03). The original installed Nightly protocol handler was restored. The live app and database were untouched. Private thread screenshots were retained locally rather than published.Focused checks
DesktopClerk.test.ts: 22 pass / 1 fails with the registration block removed; 23 pass with the fix restored.tsc --noEmit, lint/formatting for the two changed files, andgit diff --check: pass.Restoration and Windows verification: GPT-6.1-Sol via the Codex harness in T3 Code.