Fix memoized attachment existence after generation and deletion - #677
Merged
Merged
Conversation
samuelpatro
marked this pull request as ready for review
September 18, 2026 07:42
Member
|
Thanks! |
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.
When remote thumbnail generation follows a previously cached missing-file result, attachment existence checks keep returning the request's memoized
falseeven after the thumbnail is published. RepeatedgetThumb()calls then regenerate the same image. Deleting a file or thumbnail can likewise leave a memoizedtrue.Write successful publication and both deletion paths through
Cache::memo()so the backing cache and request cache stay consistent. Cache keys, storage behavior, and thumbnail URLs are unchanged.Four regression tests run the real thumbnail flow with the real resizer on a generated 4x4 image, replacing only the remote disk with an in-memory fake. The persisted-miss case now publishes once across two calls (previously twice); deletion tests verify the next read observes removal. Full suite on PHP 8.4: 234 tests, 1468 assertions.
Rechecked on 2026-09-18: the real-resizer fixture publishes a thumbnail twice on develop and once on this PR across two calls following a cached miss. The full suite still passes 234 tests / 1468 assertions. The fixture restores the resolved facade registry as well as its application.