PROD-2309: skip content items whose target container mapping is stale#190
Merged
Conversation
A container mapping row can outlive the target container it points to (e.g. the container was deleted/soft-deleted on the target since the last sync). getMappedEntity then returns null, but the payload builder silently fell back to the SOURCE reference name, which doesn't resolve to any live container on the target — the server's batch engine dereferences it as null and throws the same opaque "Object reference not set to an instance of an object." Skip the item here instead, with a message that identifies the container (not a content reference) as the cause. Confirmed via the target instance's batch/error tables: all 10 items still failing after the original unresolved-content-reference fix (PR #188) shared this exact cause, independent of field shape — three of them carry no content-reference field at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jules-exel
approved these changes
Jul 22, 2026
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.
Summary
NullReferenceExceptionafter that fix — including the ticket's original repro (eurojackpothomelinks) and theloyaltyconfignested cluster.Batch.AdditionalDatapayloads +BatchItem.ErrorMessagestack traces for sync1c55a7fd-us2→be79aa3a-us2, 2026-07-21): each of the 10 items' own container was deleted/soft-deleted on the target since the last successful mapping. The mapping row survives, butContainerMapper.getMappedEntity(..., "target")returnsnull(its local cache file is gone). Nothing checked for that null, and the payload builder fell back to the item's source reference name — which resolves to nothing on the target — so the server'sContentItemconstructor dereferences a null content view and throws the same opaque NRE.Test plan
content-batch-processor.test.tscoverage exercising the realModelMapper/ContainerMapperfile-based lookups (not mocked): one case with the mapping row present but no target container file (stale — asserts the item is skipped with the new message, zero payloads), one regression case with a live target container (asserts the item still ships normally).npx tsc --noEmitclean.