PROD-2309: guard against unresolved content references before push#188
Merged
Conversation
…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.
jules-exel
approved these changes
Jul 20, 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
NullReferenceException, surfaced to operators as an opaque "Object reference not set to an instance of an object."collectUnresolvedContentReferencesand wires it intoContentBatchProcessor.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.prettyExceptionand addsformatBatchItemErrorinbatch-polling.tsso 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.Test plan
npx tsc --noEmit— cleannpx jest --roots src -- src/lib/pushers— 29 suites / 477 tests passing{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.🤖 Generated with Claude Code