Repository navigation
fix(desktop): mirror expired cookie deletions to the partner store - #66903
gaurav0107 wants to merge 1 commit into
Conversation
A site that signs out with Set-Cookie Max-Age=0 (or a past Expires) makes Chromium report one "expired-overwrite" removal and no insert after it. The cookie mirror skipped that cause along with "overwrite", so the deletion never reached the other store and the cookie came back on the next bind. Closes anomalyco#66896
There was a problem hiding this comment.
The fix works. In the pinned Electron 44.9.1, I ran the #66896 reproduction with a local server setting and then clearing session_token. On dev, a Max-Age=0 sign-out in the remote partition left the cookie in the profile. A past-Expires sign-out from the profile side left it in the remote partition. With this change, both stores lose the cookie in both directions. The mirror's own removal echoes back once and stops there, so there is no loop. Reconcile reads the current cookie from both stores, so the old value Chromium reports in an expired-overwrite event doesn't matter. Chromium inserts nothing after an expired-overwrite, so no remove-then-reinsert flip is possible.
link.test.ts, link-machine.test.ts and electron-link.test.ts pass, and the new test fails on dev as intended. tsc -b and oxlint on the changed files are clean.
Public API: unchanged.
No blocking concerns.
Issue for this PR
Closes #66896
Type of change
What does this PR do?
When a site signs out with
Set-Cookie: name=; Max-Age=0(or a pastExpires), Chromium reports a singleexpired-overwriteremoval and no insert after it. The cookie mirror's listener skippedexpired-overwritetogether withoverwrite, so the deletion was never copied to the other store and the cookie came back on the next bind.The listener now skips only
overwrite, whose insert event follows. Anexpired-overwritegoes through the normal reconcile path, which already handles removals: the other store's copy is removed.How did you verify your code works?
link.test.ts: the fake store gets anexpirepage action that drops the cookie and reportsexpired-overwrite, as Chromium does. The test expires a shared cookie on each side and checks both stores lose it. It fails ondevand passes with the fix.bun test src/browser/profile/inpackages/gui-plugins: everything passes except the twoelectron-linktests, which need a real Electron binary I don't have locally (they fail the same way ondev).bun typecheckinpackages/gui-pluginsandbun run lint:changedare clean.Screenshots / recordings
Not a UI change.
Checklist
🤖 Opened with Superhuman, an open-source contribution agent.