fix(desktop): isolate New Window from remembered sessions - #69815
Open
kyledempster7 wants to merge 1 commit into
Open
fix(desktop): isolate New Window from remembered sessions#69815kyledempster7 wants to merge 1 commit into
kyledempster7 wants to merge 1 commit into
Conversation
Collaborator
1 task
teknium1
reviewed
Jul 30, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the peer-window lifecycle. The premise remains valid on current main: apps/desktop/electron/main.ts:8767 loads an unmarked root URL, and apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts:94-115 restores shared remembered state from that route.
Problems
- The new test at
apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.ts:5-22only invokesshouldRestoreRememberedRoute; it does not prove the hook avoids remembered-state reads, writes, or navigation. - This branch conflicts with newer profile-scoped remembered-state code (
apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts:74-85,102-114). Salvage must preserve those profile arguments while adding the fresh-instance guard.
Suggested changes
- Add a hook-level regression that asserts a
?win=instanceroot launch performs no remembered-state access or navigation, then assert a real routed chat persists normally.
Automated hermes-sweeper review.
|
|
||
| it("never restores another window's remembered chat into a new peer instance", () => { | ||
| expect(shouldRestoreRememberedRoute({ freshInstanceWindow: true, locationPathname: '/', restored: false })).toBe( | ||
| false |
Contributor
There was a problem hiding this comment.
Please add a hook-boundary regression alongside this helper test: mount useDesktopIntegrations for a fresh root instance and assert it neither reads nor writes remembered state and does not navigate. This helper assertion alone cannot catch a misplaced or removed effect guard.
This was referenced Aug 1, 2026
Open
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.
Fixes #65601.\n\nNew Window created a full peer renderer at the root route, but that renderer shares Chromium local storage with the primary window. Its cold-start restore therefore reopened the primary window's remembered route/session.\n\nThis marks peer New Window URLs as fresh instances and skips both the initial remembered-route write and cold-start restore only for that launch. Once the new window creates or opens a real chat, normal remembered-session behavior resumes.\n\nValidation run from apps/desktop:\n- npm run typecheck\n- npm run lint: 0 errors; 13 existing warnings\n- npm run test:desktop:platforms: 697 checks passed\n- npm run test:ui\n- focused Electron URL and Desktop restore regression tests