Fix excerpt generator not called when autoGenerate becomes true#10042
Merged
Conversation
PostReconciler and SinglePageReconciler use content checksum alone as cache key in getExcerpt(). When content is unchanged but excerpt.autoGenerate switches from false to true, the cache hits and ExcerptGenerator is skipped. This commit includes autoGenerate flag into the cache key so that excerpt is regenerated whenever the autoGenerate state changes. Fixes #10039
|
4 tasks
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 type of PR is this?
What this PR does / why we need it:
PostReconcilerandSinglePageReconcileruse content SHA256 checksum alone as the cache key ingetExcerpt(). When the article content is unchanged butexcerpt.autoGenerateswitches fromfalsetotrue, the cache hits and the old excerpt is returned directly, skipping allExcerptGeneratorcalls (including plugin extensions and theDefaultExcerptGeneratorfallback).This PR includes the
autoGenerateflag into the cache key so that the excerpt is regenerated whenever theautoGeneratestate changes, even if the content itself has not been modified.Which issue(s) this PR fixes:
Fixes #10039
Special notes for your reviewer:
This change is backward compatible: the old
checksum/contentannotation stores a pure content checksum (e.g.abc123), while the new cache key format isabc123:trueorabc123:false. On the first reconcile after upgrade, the old key will not match, triggering a one-time regeneration and updating the annotation to the new format.Does this PR introduce a user-facing change?