Repository navigation
fix(electron): remove the unreachable web-cookie login path (#14705) - #14689
Conversation
e070363 to
c0b9a6d
Compare
…inference#14705) The login:* IPC handlers could never work: their only persist step required ../src/lib/db/secrets, a TypeScript path that plain CJS can never resolve, so every successful extraction reported failure. No renderer code ever called the preload API either, and even a resolved require would have written a secrets-namespace blob nothing reads instead of creating a provider connection. Remove the whole path rather than repair it: the login:* handlers in main.js, the preload exposure and channel allowlist entries, loginManager.js, its only consumer lib/loginHeaderCapture.js, and the matching build.files entries. Cookie-provider login stays on the server-side inAppLoginService, which is the surface the dashboard actually uses. Adds a regression guard so the path cannot silently resurrect.
c0b9a6d to
8ad4218
Compare
|
Thanks @gonisulaimann, and your diagnosis is spot on. I reproduced it on the tip: both As I mentioned on #14705, we've decided to remove the Electron web-cookie login path instead of repairing it. Nothing in the renderer calls Would you like to re-scope this PR into the removal? Here's the exact list, checked against the current
I dry-ran this removal on the tip. If you'd rather not, no problem: we'll do the removal ourselves and credit you as co-author in the commit, since you found both halves of this. |
…-cookie login removal - knip.json: remove the deleted electron/loginManager.js entry point. - tokenExtractionConfig.ts: the shared config map is now only consumed by InAppLoginService.
93b14b8
into
cheaper-inference:release/v3.8.51
Re-scoped per the decision in #14705 (comment): remove the dead Electron web-cookie login path instead of shipping a CJS mirror for it. The original scope of this PR (an esbuild-generated
tokenExtractionConfigmirror to fix theloginManager.jsrequire) is superseded — with the path removed, that mirror has no consumer.What was wrong
Two halves, both verified in #14705:
electron/main.jsrequired../src/lib/db/secretsfrom plain CJS. That module only exists as TypeScript, so the require always threwMODULE_NOT_FOUNDand a successful credential extraction was reported as a failure.persistSecretwrites a blob into thesecretsnamespace that only JWT/API-key secret readers consume — no provider connection would ever be created from it.And the path was unreachable anyway: the preload exposes
startLogin/onLoginStatus, but no renderer code ever calls them. The dashboard's cookie-provider login goes through the server-sideinAppLoginService(HTTP), not Electron IPC.Together with #14660 (the
tokenExtractionConfig.tsrequire inloginManager.js, fixed server-side by #14689's original scope being unnecessary), the entire Electron web-cookie login path was dead code that could never work.What changed
login:start/login:cancel/login:statusIPC handlers and theloginManagerstatus forwarder fromelectron/main.js.startLogin,cancelLogin,getLoginStatus,onLoginStatus) and the threelogin:*channel allowlist entries.electron/loginManager.jsandelectron/lib/loginHeaderCapture.js(its only consumer) and their twobuild.filesentries (including the pre-existing duplicatelib/loginHeaderCapture.jslisting).tests/unit/electron-login-header-capture.test.ts(tested the removed module).inAppLoginService.tsthat pointed toelectron/loginManager.jsas the "Electron-native" alternative.tests/unit/electron-main.test.ts(fix(startup): Electron login:start IPC is unreachable and its credential persist can never succeed (requires a .ts path from CJS) #14705): the removed modules, IPC channels, preload API, andbuild.filesentries must not silently reappear.changelog.d/maintenance/14689-electron-login-removal.mdfragment per the changelog convention.Verification
tests/unit/electron-main.test.ts— 39 pass (incl. 4 new guards).node --checkon the edited CJS entry points; Prettier clean; my touched files contribute 0 new tsc/eslint violations (suppression counts unchanged).loginManager/loginHeaderCapture/login:*outside historical i18n CHANGELOG mirrors.Base-red note:⚠️ base-red inherited: #14547 (known typecheck/test failures being fixed in #14693/#14683 — unrelated to this PR).
Closes #14705.
Maintainer rework (merge-batch 2026-09-24)
I checked this head against the removal checklist agreed on #14705. Everything in the list is done except two leftover references, which I fixed in one commit on top (after a real merge of the current
release/v3.8.51tip; your commit is untouched):knip.json: removed theelectron/loginManager.jsentry point, which no longer exists.open-sse/services/tokenExtractionConfig.ts: the comment onTOKEN_EXTRACTION_CONFIGSno longer lists LoginManager as a consumer.Verification:
node --checkpasses onelectron/main.jsandelectron/preload.js.git grepfinds no remainingloginManager/loginHeaderCapture/login:*channel references outside historical changelog mirrors.tests/unit/electron*.test.ts): 166/167. The one failure,electron-server-readiness, is a load flake: this PR doesn't touch that file, and it passes 4/4 when run alone.tests/unit/electron-main.test.tsrun against the tip'selectron/fails the 4 new removal guards, and passes 39/39 on this head.Also closes #14660: the broken
tokenExtractionConfigrequire it reports lived inloginManager.js, which this PR deletes.Closes #14660