Repository navigation
Conversation
The client cookie now always holds the client id of the current client, i.e. what ClientContextInterface returns, decorators included. Before, a request with a cookie kept the cookie's id and the cookie writer never asked the client context. ClientContext recognizes the client by the cookie of the main request and replaces CookieBasedClientContext and DefaultClientContext. CachedClientContext decorates the interface with priority -1024, so it wraps the application's decorators, and keeps the clients in a WeakMap keyed by the request, so it needs no kernel.reset. An internal ClientCookieJar owns reading and writing the cookie and replaces the cookie providers and CookieProviderInterface. Without a request, every call gets an anonymous client. Adds GLOSSARY.md, ADR 0001 and UPGRADE-2.0.md.
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.
Summary
The current client is now the source of truth for the client id. The client cookie always holds the id of the client that
ClientContextInterfacereturns, decorators included. See ADR 0001.StoreCookieSubscriber,StoreMetadataSubscriberandClientValueResolvernow inject the interface alias, so they see app decorators. Also addsGLOSSARY.md,docs/adr/0001-…andUPGRADE-2.0.md, updates the README and CLAUDE.md, and dropssymfony/service-contracts.Evidence
DecoratedClientContextTest, run against 1.x with a decorator that names the client by a query parameter:1024) makes the metadata test fail again.AnonymousClientTest: outside a request, two calls give two anonymous clients.composer validate --strictandcomposer normalize --dry-runclean, dependency analyser clean. The CI matrix (8.1/8.2, lowest) wasn't run locally.Merge Danger
Door: two-way
It targets the unreleased
2.xline, so a revert undoes it. The BC check is skipped for PRs into2.x.Blast Radius: consumers
When 2.0.0 ships, apps that use
CookieProviderInterfaceor the removed context classes break. Apps whose decorators return a different client id will see the cookie rewritten. Code outside a request that relied on getting the same anonymous client from repeated calls gets a new one each call.UPGRADE-2.0.mdcovers each of these.