dotCMS / dotCMS/core

Audit follow-up: MultiTree reference-count refresh invalidates only one side of diff

Open
#36,009 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Parent epic: #36004

Finding

MultiTreeAPIImpl.refreshContentletReferenceCount appears to compute a one-directional set difference based on whichever set is larger, rather than a symmetric difference. A remove/add swap may invalidate only the added contentlet and leave the removed contentlet cached with a stale reference count.

Report reference: dotCMS/src/main/java/com/dotmarketing/factories/MultiTreeAPIImpl.java:1804-1814

Potential impact

Editors may see incorrect page/reference counts, including content wrongly reported as still in use until unrelated cache eviction.

Suggested validation

Create a page/content relationship, swap content A for content B, and inspect reference counts for both contentlets before and after cache eviction.

Possible fix

Invalidate the union of added and removed identifiers, or invalidate all original and updated identifiers if that is simpler and safe.

Caveat

This was AI-found by Claude from .scratch/audit/REPORT.md. Please perform secondary validation of correctness, severity, and value before actioning.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dotCMS/src/main/java/com/dotmarketing/factories/MultiTreeAPIImpl.java around lines 1804-1814 and trace how the added and removed identifiers are derived and invalidated. Reproduce the stated page/content swap, inspecting both contentlets before and after cache eviction. Done means both sides show current reference counts, with relevant test coverage added or updated if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, content
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.