Skip to content

fix: correct content ID mapping misalignment when batch items are skipped (PROD-1024)#130

Draft
5PK wants to merge 1 commit into
mainfrom
PROD-1024
Draft

fix: correct content ID mapping misalignment when batch items are skipped (PROD-1024)#130
5PK wants to merge 1 commit into
mainfrom
PROD-1024

Conversation

@5PK
Copy link
Copy Markdown
Collaborator

@5PK 5PK commented May 1, 2026

Bug

When prepareContentPayloads encounters orphaned content items (missing model or container), it skips them, producing a payloads array that is shorter than the original contentBatch. The downstream call to extractBatchResults was still receiving the full contentBatch, causing every result after the first skipped item to be matched against the wrong source item.

This corrupted the source→target content ID mappings and produced incorrect zone content IDs during page push.

Fix

prepareContentPayloads now returns includedItems alongside payloads — representing only the non-skipped source items in 1:1 correspondence with the payloads actually sent to the API. extractBatchResults is called with includedItems instead of contentBatch, ensuring correct alignment between API results and source items.

Changes

  • src/lib/pushers/content-pusher/content-batch-processor.ts: Updated prepareContentPayloads to return { payloads, includedItems } and updated the call site to pass includedItems to extractBatchResults.

Ticket

PROD-1024

…ed (PROD-1024)

When prepareContentPayloads skips orphaned content items (missing model/container),
the payloads array is shorter than contentBatch. Passing contentBatch to
extractBatchResults caused every result after the first skip to be matched against
the wrong source item, corrupting the source→target content ID mappings and
producing wrong zone content IDs during page push.

Fix: prepareContentPayloads now returns includedItems alongside payloads —
only the non-skipped source items in 1:1 correspondence with what was sent to
the API. extractBatchResults is called with includedItems instead of contentBatch.
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.

1 participant