Skip to content

Make updateSiblings and resetChildrenIndexBy fully async#426

Open
cancan101 wants to merge 2 commits into
pimcore:2026.xfrom
cancan101:claude/github-issue-389-fOm4d
Open

Make updateSiblings and resetChildrenIndexBy fully async#426
cancan101 wants to merge 2 commits into
pimcore:2026.xfrom
cancan101:claude/github-issue-389-fOm4d

Conversation

@cancan101

Copy link
Copy Markdown
Contributor

Changes in this pull request

Resolves #389

Additional info

  • DataObjectIndexUpdateSubscriber::updateDataObject() and DocumentIndexUpdateSubscriber::updateDocument() were calling IndexElementIndexService::updateSiblings() and resetChildrenIndexBy() synchronously, making blocking calls to the search provider (e.g. OpenSearch/Elasticsearch) during HTTP requests
  • Introduced UpdateSiblingsMessage and UpdateSiblingsHandler to dispatch sibling/children index updates via the Symfony Messenger bus, so they are processed asynchronously through the existing pimcore_generic_data_index_queue transport
  • Removed the direct IndexElementIndexServiceInterface dependency from both event subscribers, replacing it with MessageBusInterface to dispatch the new message

This eliminates the synchronous search-provider roundtrips that caused significant slowdowns during object updates, especially for large folders.

Test plan

  • Verify data object updates dispatch UpdateSiblingsMessage to the queue instead of blocking
  • Verify document updates dispatch UpdateSiblingsMessage to the queue instead of blocking
  • Verify sibling index values are correctly updated after async processing
  • Verify resetChildrenIndexBy is triggered for data objects with OBJECT_CHILDREN_SORT_BY_INDEX sort mode
  • Verify no regressions in add/delete operations (unchanged paths)
  • Confirm message routing via config/pimcore/messenger.yaml

cancan101 added 2 commits May 25, 2026 15:49
The updateDataObject and updateDocument event subscribers were calling
IndexElementIndexService::updateSiblings() and resetChildrenIndexBy()
synchronously, which made blocking calls to the search provider during
HTTP requests. This caused significant slowdowns for large folders.

Dispatch an UpdateSiblingsMessage via the message bus so that sibling
and children index updates are processed asynchronously through the
existing queue infrastructure, consistent with how updateData() works.
Tests cover:
- UpdateSiblingsHandler: verifies service method dispatch based on
  element type, sort-by-index flag, resetChildrenIndexBy flag, and
  null element handling
- DataObjectIndexUpdateSubscriber: verifies UpdateSiblingsMessage is
  dispatched with correct parameters
- DocumentIndexUpdateSubscriber: same verification for documents
@sonarqubecloud

Copy link
Copy Markdown

@cancan101

Copy link
Copy Markdown
Contributor Author

Follow up PR: cancan101#2

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.

updateDataObject is only partially async

2 participants