Repository navigation
[6.x] Fix duplicate ids being lost when the Stache is cleared and warmed in one process - #15883
Merged
jasonvarga merged 1 commit intoNov 13, 2026
Conversation
…one process Clearing forgot the duplicates in the cache but not the ones in memory. When the warm that followed found the same duplicate again it wasn't new, so nothing was written back, and the list stayed empty until the next clear. Every other stache:refresh lost them.
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.
php please stache:refreshloses the list of duplicate ids every other time it runs.Stache::clear()forgets the duplicates in the cache butDuplicateskeeps the ones it has loaded in memory. When the warm that follows comes across the same duplicate again,track()finds the path already in its list and returns without marking anything as changed, socache()writes nothing. The cache stays empty until the next clear, which starts from an empty list, sees the duplicate as new, and writes it back.The effect is that the "Duplicate IDs" item in the Control Panel nav, and the page behind it, come and go: they depend on whether the Stache has been refreshed an odd or an even number of times since the duplicate appeared.
Duplicates::clear()now empties its own list as well.Reproducing it
On
6.x, with two entries that share an id:and then, from another process,
Stache::duplicates()->all()is empty. Run it again and the duplicate is back. With this change it's there every time.It doesn't happen if the two steps run in separate processes, or if the application cache is flushed in between and the Stache is kept in the default store.
Tests
A duplicate that is found again after clearing is written back to the cache. Fails without the change.