Skip to content

SYNCASE-2653 Avoid reindexing unchanged attachments - #106

Open
ebeutler wants to merge 1 commit into
devfrom
SYNCASE-2653
Open

SYNCASE-2653 Avoid reindexing unchanged attachments#106
ebeutler wants to merge 1 commit into
devfrom
SYNCASE-2653

Conversation

@ebeutler

Copy link
Copy Markdown
Member

Questions I had and the AI answers I got:

  1. I had a look at the changes and have seen you used getRenderedTitle to compare the titles. Is there a reason the title should be rendered instead of just comparing the results of getTitle?

Yes. AttachmentData indexes doc.getRenderedTitle(...), not getTitle() (abstractdocumentdata.java:110).

Using getTitle() would miss changes when the title is empty and derived from content, or when unchanged title markup renders differently due to document data. Comparing the indexed value avoids stale attachment titles; the cost is only two renders per update.

Is this actually something that can even happen in celements? I'm not sure ...

  1. In line 51 only the docRef is returned for indexing. Shouldn't the one attachment that was uploaded / deleted also be part of the stream?

No. The changed attachment is queued separately:

  • xwiki.java:5678 converts attachment diffs into added/updated/deleted events.
  • queueattachmenteventconverter.java:47 queues exactly that attachment.
  • Deletions become delete tasks through isDeleteEvent().

Adding it to the document stream would duplicate uploads/updates, while deleted attachments are no longer in the document list anyway. Line 51 is intentional.

@fpichlerfpichler assigned ebeutler and unassigned fpichlerAug 28, 2026
Sign up for freeto 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.

2 participants

@ebeutler@fpichler