PROD-2306: clearer message for items referencing a deleted linked list#183
Merged
Conversation
When a content item references a linked list / linked container that was deleted in the source, the create fails and the Management API's misleading "... does not exist" text was surfaced verbatim. Detect the deleted reference proactively (absent from the live source containers, which the pull prunes on delete) and replace the surfaced error with a clear, actionable message. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jules-exel
approved these changes
Jul 14, 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.
Root cause
When a content item references a linked list / linked container that has been deleted in the source, pushing the item fails and the CLI surfaces the Management API's response verbatim, e.g.:
The linked list isn't truly "nonexistent" — it was deleted. The pull prunes the deleted container's file locally (see
download-containers.ts, which unlinks containers no longer returned by the source), and the CLI correctly refuses to recreate a deleted container on the target — so the target create fails. Thedoes not existtext comes from the server, not our code, and it misleads triagers into thinking the reference name was never valid.What changed
Scope is message clarity only.
src/lib/pushers/content-pusher/util/detect-deleted-linked-list-references.ts:collectAllReferenceNames(fields)— walks a content item's fields and gathers every linked-list/containerreferencename/referenceName.findDeletedLinkedListReferences(fields, liveSourceContainerRefNames)— returns the referenced names absent from the live source containers (i.e. deleted).buildDeletedLinkedListMessage(...)— builds the clear, actionable message and appends the original server error for triage context.content-batch-processor.ts:containers/folder.clarifyFailedItemErrorreplaces the surfaced error with:Content item '<item>' references a deleted linked list '<name>' — clear the stale reference in the source or restore the list. (original error: ...)Detection approach + limitation
Proactive, not string-matching the server text. A referenced linked list is treated as deleted-not-missing when its reference name is absent from the live source containers (the pull removes deleted containers' files, so absence is the deleted signal). This is applied at the failure-surfacing point: only failed items are re-messaged, and only when we can positively identify a deleted reference — otherwise the original error is preserved untouched.
Limitations:
Deferred (out of scope — needs a product decision)
Graceful degradation — skipping/emptying the dangling linked-list field and creating the item anyway — is intentionally not implemented here. It changes what data lands on the target and should be a deliberate product decision. Tracking for follow-up on the ticket.
🤖 Generated with Claude Code