Skip to content

PROD-2309: guard against unresolved content references before push#188

Merged
5PK merged 1 commit into
mainfrom
PROD-2309-unresolved-content-refs
Jul 20, 2026
Merged

PROD-2309: guard against unresolved content references before push#188
5PK merged 1 commit into
mainfrom
PROD-2309-unresolved-content-refs

Conversation

@5PK

@5PK 5PK commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: linked/nested content references with no source→target mapping were shipped with the stale source contentID; the server's batch engine dereferences it as null and throws a NullReferenceException, surfaced to operators as an opaque "Object reference not set to an instance of an object."
  • Adds collectUnresolvedContentReferences and wires it into ContentBatchProcessor.prepareContentPayloads (new STEP 3.5) — skips an item before the API call with a precise, actionable reason (field path + unmapped source contentID) instead of shipping a payload guaranteed to fail server-side.
  • Implements the previously-stubbed prettyException and adds formatBatchItemError in batch-polling.ts so server error messages keep the exception type and failing server method (e.g. NullReferenceException: ... [server: BatchInsertContentitem]) instead of being regex-stripped down to the bare message.
  • Renames the skip log line from "Orphaned content item" to "Skipping content item N (ref)" to reflect the broader set of skip reasons.

Test plan

  • npx tsc --noEmit — clean
  • npx jest --roots src -- src/lib/pushers — 29 suites / 477 tests passing
  • Verified against the real compiled dist modules with the actual {referencename, sortids, fulllist:false} payload shape (12 mapped→112, 13 unmapped): field mapper ships source id 13 unchanged; guard detects and skips it with the unresolved-reference message.
  • Repro-verify at runtime against the reporting cluster (loyaltyconfig / eurojackpothomelinks) if a fresh repro window is available.

🤖 Generated with Claude Code

…reserve server exception type in errors

Linked/nested content refs with no source→target mapping were shipped
with the stale source contentID, which the server dereferences as null
and throws a NullReferenceException surfaced to operators as an opaque
"Object reference not set to an instance of an object." Skip such items
before the API call with a precise reason (STEP 3.5 in
content-batch-processor), and stop stripping the exception type/server
method out of batch error messages so a server-side crash is
distinguishable from a plain validation failure.
@5PK
5PK merged commit fd22216 into main Jul 20, 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