Skip to content

fix(push-publishing): archived Site no longer deleted on receiver (#36034)#36174

Merged
dsilvam merged 3 commits into
mainfrom
issue-36034-archived-site-push-delete
Jun 18, 2026
Merged

fix(push-publishing): archived Site no longer deleted on receiver (#36034)#36174
dsilvam merged 3 commits into
mainfrom
issue-36034-archived-site-push-delete

Conversation

@dsilvam

@dsilvam dsilvam commented Jun 15, 2026

Copy link
Copy Markdown
Member

Proposed Changes

  • Guard HostAPI.delete() in ContentHandler.archiveOrDeleteContent() behind !isPushedContentArchived so that pushing an archived Site with a non-Remove operation archives it on the receiver instead of deleting it.
  • Add integration tests to HostBundlerHandlerTest covering both the fixed path (PUBLISH + archived → site preserved) and the regression path (UNPUBLISH + archived → site deleted).

Root Cause

In ContentHandler.archiveOrDeleteContent(), the Host/Site branch (lines 1277–1282) ignored the isPushedContentArchived parameter and unconditionally called archive() then delete(). The regular-content else branch already guarded destroy() behind !isPushedContentArchived correctly — the Host branch simply lacked the same guard.

Checklist

  • Tests
  • Translations
  • Security Implications Contemplated (no security impact — this tightens deletion criteria, it does not relax them)

Additional Info

Fixes #36034. When a Site is archived on the sender and pushed with any non-Remove / Push Remove action, the receiver now sets the Site to archived state instead of deleting it and all its content. The explicit Remove/Push Remove path is unaffected.

Screenshots

N/A — backend-only change

This PR fixes: #36034

…6034)

When pushing an archived Site with a non-Remove operation, the receiver
was unconditionally calling HostAPI.delete() after archive(), ignoring
the isPushedContentArchived flag. Added a guard so delete() is only
called for explicit Remove/Push Remove operations, matching the existing
pattern used for regular content in the same method.

Refs: #36034

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

❌ Codex Review failed — openai.gpt-5.5

The review job failed before producing output. See the run for details.

Run: #27571110688

@claude

claude Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Claude finished @dsilvam's task in 3m 36s —— View job


dotCMS Backend Review

  • Load dotCMS conventions (CLAUDE.md + docs)
  • Get the Java diff
  • Read changed files for full context
  • Security review — no findings
  • DB / transaction review — no findings
  • Java standards review — no findings
  • REST API review — no findings (no REST surface in changed files)
  • Consolidate and post review comment

All four specialized sub-agents (Security, Database, Java Standards, REST API) returned no issues. The backend review comment has been updated accordingly.

Note: Formal PR approval via gh pr review --approve was blocked by permissions — a human reviewer will need to approve.

@claude

claude Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
\n✅ **dotCMS Backend Review**: no issues found.

@dsilvam dsilvam enabled auto-merge June 18, 2026 13:21
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🤖 Bedrock Review — deepseek.v3.2

[🟠 High] dotCMS/src/enterprise/java/com/dotcms/enterprise/publishing/remote/handler/ContentHandler.java:1281 — The condition if (!isPushedContentArchived) introduces a bug: isPushedContentArchived is not defined in this scope. This will cause a compilation error or runtime failure if the variable is not accessible. The logic depends on this flag to decide deletion, but its source is unclear.

[🟡 Medium] dotcms-integration/src/test/java/com/dotcms/enterprise/publishing/remote/HostBundlerHandlerTest.java:271 — The test cleanup logic is flawed: hostAPI.archive(site, user, false); is called before delete in the finally block, but if the site is already archived (or deleted by the test), this may throw an exception, potentially masking the real test outcome.


Run: #27768180420 · tokens: in: 2739 · out: 195 · total: 2934

HostAPI.delete() requires the site to be archived first. Both new test
finally blocks were incorrectly calling unarchive() before delete(),
causing the cleanup to fail and leaving leaked sites in the DB which
broke the count assertions in the pre-existing tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dsilvam dsilvam added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit 02c5ab5 Jun 18, 2026
63 checks passed
@dsilvam dsilvam deleted the issue-36034-archived-site-push-delete branch June 18, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Backend PR changes Java/Maven backend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Push publishing an archived Site deletes it on receiver instead of syncing its archived state

3 participants