fix(EditContent): handle image duplication warnings when source has no storage bucket - #1969
Conversation
johan-bell
left a comment
There was a problem hiding this comment.
Looks good — the warning fires exactly when the user asked to copy but the source has image files and no imageBucketId, and the buildContentDuplicate refactor preserves the clearing behaviour on the other paths. Two tiny nits, no need to block: the copied/skipped/none outcome variants are computed but unused (only noSourceBucket is consumed), and the PR body is empty — worth noting there that the trigger is a missing imageBucketId on older posts rather than expiry.
ivanslabbert
left a comment
There was a problem hiding this comment.
The fix does not resemble the issue in the linked ticket
8be3a41 to
66d1983
Compare
66d1983 to
0a83b07
Compare
…tion fix Provisional and expected to be superseded. ImageEditor cleared a parent's imageBucketId whenever the bucket was missing from the user's synced Storage list, which strips the reference the duplication path reads. The clearing is removed here and the condition only reported. The duplication path still trusts client-supplied bucket state, so this does not yet make the copy reliable. The server-side duplicateFrom resolution replaces the remaining warning path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Duplication asked the client to supply the bucket its image files live in, via the clone's own imageBucketId. A CMS that had lost or never synced that reference produced a duplicate with no image, and the API had no way to tell. ImageDto now carries duplicateFrom — the id of the parent being copied. The API reads that document's bucket and file collections itself and copies out of the source bucket into the duplicate's, so the result no longer depends on client state. duplicateFrom requires View access to the named document, since the server reads it on the caller's behalf. The duplicate boolean is still honoured for deployed clients that send it (ADR 0005), falling back to the same-bucket copy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
MrDirkelz
left a comment
There was a problem hiding this comment.
Check if we can have a simpler approach where we can include all of the files for duplication for images in the client. Then we can simplify this perhaps?
No description provided.