This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-747bbb2c-76e4-46a3-be4b-2c249497999f XWIKI-24555 Open

Abusive modification of the cached document when moving an attachment

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-3631e356-96e9-4e04-a4c7-a3335b08c562 Ilie Andriuta created this issue on 07/Jul/26 13:37
 
Summary: Abusive modification of the cached document when moving an attachment
Issue Type: cid:jira-generated-image-avatar-747bbb2c-76e4-46a3-be4b-2c249497999f Bug
Affects Versions: 17.10.9, 18.4.2, 18.5.0
Assignee: Unassigned
Attachments: Abusive_modification_attahcment_move.png
Components: Attachments
Created: 07/Jul/26 13:36
Environment: Windows 11 Pro, Firefox 152, using an instance of XWiki 18.4.2 on PostgreSQL 17, Tomcat 11.0.23
Priority: cid:jira-generated-image-static-major-cfdf5547-e07d-4de0-b89f-d064e45e248a Major
Reporter: Ilie Andriuta
Description:

Steps to reproduce

  1. Add an attachment to a page
  2. Go to 'Attachments' tab, click on 'Move' from the 'Actions' column
  3. Choose a new page under 'New Attachment Location'
  4. Click 'Submit' button
  5. Click on 'Job log' to expand and observe the move logs

Expected results

No warnings are displayed (related to abusive modifications).

Actual results

The following warning is displayed twice:

 Abusive modification of the cached document
class java.lang.IllegalStateException: Abusive modification of the cached document
    at com.xpn.xwiki.doc.XWikiDocument.warnWithStackTrace(XWikiDocument.java:9416)
    at com.xpn.xwiki.doc.XWikiDocument.setMetaDataDirty(XWikiDocument.java:2459)
    at com.xpn.xwiki.internal.doc.XWikiAttachmentList.updateList(XWikiAttachmentList.java:263)
    at com.xpn.xwiki.internal.doc.XWikiAttachmentList.remove(XWikiAttachmentList.java:158)
    at com.xpn.xwiki.doc.XWikiDocument.removeAttachment(XWikiDocument.java:5692)
    at com.xpn.xwiki.doc.XWikiDocument.removeAttachment(XWikiDocument.java:5678)
    at org.xwiki.attachment.internal.refactoring.job.MoveAttachmentJob.moveAttachment(MoveAttachmentJob.java:162)
    at org.xwiki.attachment.internal.refactoring.job.MoveAttachmentJob.process(MoveAttachmentJob.java:112)
    at org.xwiki.refactoring.internal.job.AbstractEntityJob.process(AbstractEntityJob.java:225)
    at org.xwiki.refactoring.internal.job.AbstractEntityJob.runInternal(AbstractEntityJob.java:202)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
    at java.base/java.lang.Thread.run(Thread.java:1474)

No warnings on the XWiki console.

The issue could be also reproduced on XWiki 17.10.9 and 18.6.0-SNAPSHOT.