Skip to content

Change CookieJar behaviors ahead of the async conversion - #26106

Open
crazytonyli wants to merge 5 commits into
task/cookiejar-remove-unused-codefrom
task/cookiejar-behavior-changes
Open

crazytonyli wants to merge 5 commits into
task/cookiejar-remove-unused-codefrom
task/cookiejar-behavior-changes

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

One commit per change:

  1. Shared cookie lookup. Auth cookie checks read all cookies and match the URL in shared code. HTTPCookieStorage stops using its built-in URL matching, and every WebKit cookie read gets the 2-second timeout.
  2. No main-thread block when removing WebKit cookies. The completion handler runs when the deletions finish, with no timeout.
  3. WebKit cookies are set first-to-last, the same order as HTTPCookieStorage.
  4. WebKit cookie jar tests fixed, without the expected-failure marker.
  5. Private Atomic request with no default account calls its completion handler with the plain request. This one has a new test.

Auth cookie checks now read all cookies and match them against the URL in shared code, instead of each jar matching URLs on its own. HTTPCookieStorage no longer uses its built-in URL matching, and every WebKit cookie read gets the timeout that guards against getAllCookies not calling back.
WebKit reports each deletion on the main thread, so waiting for the deletions there always ran into the two-second timeout. The completion handler is now called when the deletions finish, without a timeout.
The WebKit cookie store set cookies from last to first, while HTTPCookieStorage sets them from first to last. Both now use the same order, so the same cookie wins when the list holds duplicates.
The tests did not wait for their cookies to be set and let the data store that owns the cookie store be deallocated, so they were marked as expected failures. They now pass without that marker.
The request authenticator returned without calling its completion handler, so the web view never loaded. It now hands back the plain request, as the other failure paths do.
@crazytonyli
crazytonyli added this pull request to stack #26107 October 1, 2026 02:43
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@crazytonyli crazytonyli changed the title task/cookiejar behavior changes Change CookieJar behaviors ahead of the async conversion Oct 1, 2026
@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number34801
VersionPR #26106
Bundle IDcom.jetpack.alpha
Commit6055290
Installation URL1obbutve4iqso
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number34801
VersionPR #26106
Bundle IDorg.wordpress.alpha
Commit6055290
Installation URL2anvhhdqrs9mg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@crazytonyli
crazytonyli requested a review from jkmassel October 1, 2026 04:58
@crazytonyli crazytonyli added this to the 27.4 milestone Oct 1, 2026
@crazytonyli
crazytonyli marked this pull request as ready for review October 1, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants