Skip to content

fix(EditContent): handle image duplication warnings when source has no storage bucket - #1969

Open
MrDirkelz wants to merge 3 commits into
mainfrom
1963-cms-api-image-not-duplicated-when-duplicating-an-expired-post
Open

fix(EditContent): handle image duplication warnings when source has no storage bucket#1969
MrDirkelz wants to merge 3 commits into
mainfrom
1963-cms-api-image-not-duplicated-when-duplicating-an-expired-post

Conversation

@MrDirkelz

Copy link
Copy Markdown
Collaborator

No description provided.

@MrDirkelz MrDirkelz linked an issue Aug 31, 2026 that may be closed by this pull request

@johan-bell johan-bell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ivanslabbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix does not resemble the issue in the linked ticket

@MrDirkelz
MrDirkelz force-pushed the 1963-cms-api-image-not-duplicated-when-duplicating-an-expired-post branch from 8be3a41 to 66d1983 Compare September 1, 2026 10:44
@MrDirkelz MrDirkelz self-assigned this Sep 1, 2026
@MrDirkelz
MrDirkelz force-pushed the 1963-cms-api-image-not-duplicated-when-duplicating-an-expired-post branch from 66d1983 to 0a83b07 Compare September 2, 2026 14:14
MrDirkelz and others added 2 commits September 2, 2026 16:36
…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>
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.

CMS, API: Image not duplicated when duplicating an expired post

3 participants