fix: improve iri converter cache - #8472
Merged
Merged
Conversation
Johannes-Werbrouck
force-pushed
the
4.3
branch
from
August 22, 2026 07:57
0fa6b30 to
5e6e099
Compare
Johannes-Werbrouck
force-pushed
the
4.3
branch
from
August 22, 2026 07:58
5e6e099 to
12eeb46
Compare
Reading the local operation cache on the no-operation path exposed a key collision: an item_uri_template that resolves to no operation leaves $operation null, so the key matches a plain call, while the skolem check and the resource class promotion are both skipped. The first caller then wins for the rest of the request. Also drops the redundant "reuses the cached operation" tests and rewrites the new Symfony ones with PHPUnit mocks instead of Prophecy.
Member
|
`thanks! |
This was referenced Sep 2, 2026
soyuka
added a commit
that referenced
this pull request
Sep 2, 2026
* fix(laravel): key the iri operation cache on Relation #8472 added a localOperationCache read on the unnamed-operation path. A Relation and its related model share a cache key but resolve differently: the Relation skips the resource class promotion, so a model-first call poisons the key and the Relation call then throws instead of returning a skolem IRI. * test(laravel): cover the Relation iri cache key end to end The unit test stubs the decorated skolem converter, so it cannot reproduce the actual failure: the promoted item operation makes the identifiers extractor throw on the Relation. Resolve both inputs through the container to pin the real chain.
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.
The IriConverter's localOperationCache was always written and never read, because $operation being null short-circuits the cache read. This has been fixed.