Repository navigation
Sidebar browser guests lose site logins on restart: give the workspace partition a persist: identity #11104
tanyicheng1750
started this conversation in
Ideas
Replies: 1 comment
|
+1 — I have the same requirement and am experiencing the same issue. I built [dsh-chatgpt-panel](https://github.com/0xlic/dsh-chatgpt-panel), a plugin that embeds ChatGPT in the DSH desktop UI using Signing in works during an app session, but after fully quitting and reopening DSH, the embedded page loses its login state and requires signing in again. Environment: macOS, DSH Desktop An opt-in persistent partition with a stable identity across app restarts would meet my needs, without requiring cookie access or weakening the existing guest isolation. An explicit “clear site data” action would also make sense. Happy to test a pre-release build with this capability. Thanks! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Sidebar browser guests lose site logins on restart: give the workspace partition a
persist:identitySummary
The built-in Sidebar browser keeps its cookies in an in-memory Electron session, so every site login (ChatGPT, GitHub, any account-scoped page) is lost each time the desktop app restarts. One-line fix: give the per-workspace partition a
persist:identity, exactly likeplatform-view.tsalready does for the account window.Why it happens
apps/desktop/src/browser-guests.ts:24-41:Two independent consequences of the missing prefix:
persist:as a memory-only session: cookies, localStorage, IndexedDB and cache never reach disk. On quit they are gone.randomUUID(), so even if the storage were persisted, the next launch would compute a different name and open a different (empty) profile.The doc comment is explicit about the intent — "process-lifetime partition" — but the visible effect is that the Sidebar browser is a fresh browser on every launch, while the rest of the app (profile, chats, plugin state) is persistent. Users notice this as "the sidebar browser logged me out again".
Why it cannot be worked around from a plugin
Worth stating because it is the reason this needs an upstream change rather than a workaround:
partitionis chosen in the main process and handed back through the lease; the IPC request carries only the workspace key, so a plugin cannot ask for a different partition.will-attach-webviewinbind()(line ~76) rejects any webview whoseparams.partition !== lease.partition, so a plugin cannot create its ownpersist:guest in the sidebar either.HttpOnly(__Secure-next-auth.session-tokenon chatgpt.com), invisible toexecuteJavaScript, so nothing readable can be exported and replayed into a fresh partition.Net effect: any plugin that drives the built-in browser (there are several in the
dsh-plugintopic) starts every session logged out, and the only remedies available to it are "ask the user to log in again" or "patchapp.asar" — the latter breaks the code signature, so it is not a real option.Proposed change
apps/desktop/src/browser-guests.ts:That is the whole patch. It follows the precedent already in this directory —
platform-view.ts:105:: `persist:dsh-platform-${createHash('sha256').update(JSON.stringify([account.origin, account.userId])).digest('hex')}`Properties
leases,release(),attached, orconfigureSession()needs to change.will-attach-webviewkeeps working as-is — it comparesparams.partitionagainst the lease, and the lease now carries the persistent name.<userData>/Partitions/dsh-sidebar-browser-<sha256(workspace)>/Cookies, encrypted with the same Safe Storage key the app already uses, so no new at-rest exposure beyond what the account window (persist:dsh-platform-…) already has.Things a reviewer may want to decide
Partitions/directory behind.release()'s "workspace storage survives" comment becomes literally true on disk, so a GC step (or accepting the residue) should be a conscious choice.apps/desktop/tests/already has a spec for platform partitioning; a parallel assertion that two different workspaces get different persistent names, and the same workspace gets the same name across twoDesktopBrowserGuestsinstances, would pin the behaviour.Environment
@deepseek-ai/dsh-desktop0.2.1-rc.3, Electron 44.7.0, Chrome 152https://chatgpt.com/showing "Log in"All reactions