browser: isolate favicon state by document - #336077
Dmitriy Vasyura (dmitrivMS) wants to merge 3 commits into
Conversation
Keep the committed favicon separate from pending navigation candidates. Promote candidates at commit, discard them on abort or failure, and reject superseded asynchronous requests without rewriting prior history. Preserve same-document and replacement history, and cancel favicon work on native destruction. Cover the state transitions with focused unit tests and a browser API/CDP navigation scenario. Separates favicon correctness from #335987 without introducing its snapshot protocol or the native-close fix in #336075. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Cancelling a pinned redirect leaves provisional favicon state active because subsequent cleanup events are suppressed.
Get a fresh assessment by requesting another Copilot review.
Review tier: Balanced
Findings: 1
Open findings (1)
What changed in this PR
Separates committed and provisional favicon state for integrated browser navigations.
Changes:
- Adds a document-aware favicon state manager.
- Integrates favicon lifecycle handling with navigation and history.
- Adds unit and browser API coverage.
| File | Description |
|---|---|
browserFavicon.ts |
Implements favicon state isolation. |
browserView.ts |
Connects favicon state to Electron navigation. |
browserFavicon.test.ts |
Covers favicon transitions and races. |
browser.cdp.test.ts |
Tests favicon behavior through CDP. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Open an empty browser and attach CDP before navigating the local fixture. This keeps the favicon navigation test from depending on the separate initial URL/subscription handoff race that failed Linux CI. Preserve all URL and icon assertions, history checks, and existing timeouts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Invalidate favicon work only on document replacement, failure or disposal. Reacquire current-document candidates when Electron suppresses an unchanged URL set, while retaining native updates as the fast path. Cover outgoing-page updates and requests, shared favicon URLs, navigation history, and native candidate filtering. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Validation follow-up for 6f0baf8:
The separate popup-title handoff and raw-close cleanup remain outside this PR. Setup failures were retained separately rather than counted as favicon regressions or passing runs. The raw-close exception still belongs to #336075. |
|

Keep favicon work with its committed native document until that document is actually replaced.
Favicon-only extraction from #335987, redesigned rather than copied. Based directly on
main; no popup snapshot/version protocol or native-close cleanup from #336075.