Skip to content

Make CookieJar and request authentication async - #26104

Draft
crazytonyli wants to merge 1 commit into
trunkfrom
task/cookiejar-async
Draft

crazytonyli wants to merge 1 commit into
trunkfrom
task/cookiejar-async

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

The system cookie stores already provide most of the operations CookieJar needs. Using async methods lets them satisfy the protocol directly and removes custom callback handling from cookie storage and authentication.

RequestAuthenticator keeps its completion-handler API so existing callers do not need to migrate together. Request completions now run asynchronously on the main thread. Navigation decisions that allow loading still complete synchronously.

Account removal still clears shared HTTP cookies synchronously, so delayed cleanup cannot delete cookies belonging to the next account.

@crazytonyli
crazytonyli added this pull request to stack #26105 October 1, 2026 02:19
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Oct 1, 2026 •

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 Number35553
VersionPR #26104
Bundle IDcom.jetpack.alpha
Commit9d113da
Installation URL5jflo36nbpim8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Oct 1, 2026 •

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 Number35553
VersionPR #26104
Bundle IDorg.wordpress.alpha
Commit9d113da
Installation URL4mn6ctt4ljtdo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@crazytonyli
crazytonyli removed this pull request from stack #26105 October 1, 2026 02:42
@crazytonyli
crazytonyli force-pushed the task/cookiejar-async branch from 322568c to 565132b Compare October 1, 2026 02:43
@crazytonyli
crazytonyli changed the base branch from task/cookiejar-remove-unused-code to task/cookiejar-behavior-changes October 1, 2026 02:43
@crazytonyli
crazytonyli added this pull request to stack #26107 October 1, 2026 02:43
Base automatically changed from task/cookiejar-behavior-changes to trunk October 29, 2026 23:10
CookieJar now has three async requirements that the system cookie stores mostly satisfy with their own methods. AuthenticationService, AtomicAuthenticationService and RequestAuthenticator gain async methods; RequestAuthenticator keeps completion-handler variants so its callers are unchanged.

Behaviour is unchanged, except that those completion handlers are now always called asynchronously on the main thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants