Skip to content

PROD-2309: skip content items whose target container mapping is stale#190

Merged
5PK merged 1 commit into
mainfrom
PROD-2309-stale-container-mapping
Jul 22, 2026
Merged

PROD-2309: skip content items whose target container mapping is stale#190
5PK merged 1 commit into
mainfrom
PROD-2309-stale-container-mapping

Conversation

@5PK

@5PK 5PK commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up to PROD-2309: guard against unresolved content references before push #188. Live retest on 1.0.0-beta.13.22 (ticket comment, 2026-07-21) found 10 content items still hitting the raw server NullReferenceException after that fix — including the ticket's original repro (eurojackpothomelinks) and the loyaltyconfig nested cluster.
  • Root cause, confirmed against the target instance's batch/error tables (Batch.AdditionalData payloads + BatchItem.ErrorMessage stack traces for sync 1c55a7fd-us2be79aa3a-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, but ContainerMapper.getMappedEntity(..., "target") returns null (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's ContentItem constructor dereferences a null content view and throws the same opaque NRE.
  • This is a different failure mode than PROD-2309: guard against unresolved content references before push #188's unresolved-content-reference guard (still working correctly — 3-4 items are cleanly skipped for that reason in the same run). Field shape doesn't predict this failure: ~15 items with the identical reference-field shape succeeded, and 3 of the 10 failing items carry no content-reference field at all — the item's own container is the only thing that matters.
  • Fix: when the container mapping exists but no longer resolves to a live target container, skip the item before it's shipped, with a message that clearly names the container (not a content reference) as the cause and suggests recreating the container or clearing its mapping.

Test plan

  • Added content-batch-processor.test.ts coverage exercising the real ModelMapper/ContainerMapper file-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 --noEmit clean.
  • Full pusher suite green: 29 suites / 479 tests.

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>
@5PK
5PK merged commit e06ccda into main Jul 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants