[BUGFIX] Don't leak page title state between indexing sub-requests#4701
Open
amirarends wants to merge 1 commit into
Open
[BUGFIX] Don't leak page title state between indexing sub-requests#4701amirarends wants to merge 1 commit into
amirarends wants to merge 1 commit into
Conversation
IndexingService renders many pages via frontend sub-requests within one long-lived PHP process. PageTitleProviderManager is a stateful singleton whose per-provider cache still holds the titles of the previously indexed page when the next page's document is built.
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.
What this pr does
Since the unified in-process indexing (#4559),
IndexingServicerenders many pages via frontend sub-requests within one long-lived PHP process.PageTitleProviderManageris a stateful singleton whose per-provider cache still holds the titles of the previously indexed page when the next page's document is built.All other document fields (content, url, ...) stay correct, which makes the corruption hard to spot. Verified on a production multi-site installation: documents sporadically carried the title of a page indexed earlier in the same
IndexQueueWorkerTaskrun.How to test
Tests/Unit/Typo3PageContentExtractorPageTitleTestpins both behaviors:getPageTitleDoesNotLeakTitleStateOfPreviouslyIndexedPage: a stale cache entry from another page must not win over the current page's record title.getPageTitleUsesPersistedTitleStateOfCurrentPage: persisted per-page state (page cache row) takes precedence, keeping plugin-generated titles intact for cached pages.Both tests fail against the previous implementation.
Fixes: #4700