Repository navigation
Don't throw when a dependency lookup tries a non-container key as a folder - #1202
Merged
Merged
Conversation
…older GetDependenciesAsync falls back to GetContainerAsync when the key isn't an item of the handler's type. In Umbraco 17, EntityContainerRepository.Get(Guid) matches on key alone, so a key belonging to any other node throws "Not a container object type" rather than returning null. uSync.Complete's cache service then logs a warning per item on the first push to an empty site. Catch the ArgumentException in a GetContainerSafeAsync wrapper, log at debug and treat it as no container. Umbraco 18 filters on object type, so there it is already a null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 7, 2026
This was referenced Nov 9, 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.
SyncHandlerRoot.GetDependenciesAsyncfalls back toGetContainerAsync(key)when the key isn't an item of the handler's type. In Umbraco 17,EntityContainerRepository.Get(Guid)matches onUniqueIdalone, so a key that belongs to any other node gets passed toCreateEntityand throwsArgumentException: Not a container object type.uSync.Complete hits this on the first content push (with dependencies) to an empty site: its cache service catches it and logs a warning for every item.
Change
GetContainerSafeAsyncinSyncHandlerRoot: catches theArgumentException, logs at debug and returns no container.GetDependenciesAsyncuses it. That is the only base-class caller, so it covers the content type, media type and data type handlers.Umbraco 18 adds the object-type filter to
Get(Guid), so on v18 the lookup already returns null; forward-porting this is harmless.Built locally; no tests run, and not reproduced against a live push.
🤖 Generated with Claude Code