Repository navigation
Keep the published cache current after content type imports before Umbraco 17.7 - #1102
Merged
Merged
Conversation
…braco 17.7 Two core bugs, fixed in 17.7, leave the published cache stale after a uSync content type import on 17.3-17.6: - Adding a composition only refreshed the type itself, so its children kept a published type without the new properties (umbraco/Umbraco-CMS#23433). After saving a composition change we now refresh the types composed of it. - A content type loaded from the cache kept its property types' dirty state from creation, so a variance-only change was not treated as structural (umbraco/Umbraco-CMS#23445). We now clear that state when the item is loaded for import. Both are harmless on 17.7. DistributedCache comes from StaticServiceProvider so the serializer constructors don't change. Refs #1067 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 tasks done
This was referenced Sep 30, 2026
This was referenced Sep 30, 2026
Open
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.
Follows up the "Also reviewed" table in #1067. Umbraco 17.7 fixes two core bugs that leave the published cache stale after a uSync content type import on 17.3–17.6. This works around both. All tests pass on 17.3.0 and 17.7.0 (176 of 176).
Changes
Compositions (umbraco/Umbraco-CMS#23433). On 17.3, adding a composition to a doctype only refreshes the cache for that doctype. Its children keep a published content type without the new properties until a restart.
SaveItemAsyncnow notes whether the compositions changed, and if so refreshes the types built from the doctype (GetComposedOf). This is a normal refresh that clears their published types without rebuilding content, so it costs little on 17.7, where Umbraco already does this.Property variance (umbraco/Umbraco-CMS#23445). A content type that comes back out of the cache keeps its property types' dirty state from when they were created. A change to only a property's variance then isn't treated as structural, and published content keeps serving the old values. A new
FindOrCreateAsyncoverride clears that state on an existing content type as soon as it's loaded, which 17.7 now does itself. This covers document, media and member types.DistributedCachecomes fromStaticServiceProvider, so the serializer constructors don't change.Tests
ContentTypeCacheRefreshTestsimports through the serializer, with and without a real runtime cache, and checks what the site serves. On 17.3 without the workarounds the composition test fails in both cache modes and the variance test in the real-cache one. With the workarounds all four pass, on 17.3 and on 17.7.Refs #1067
🤖 Generated with Claude Code