Problem/Motivation
Every ACT on-demand endpoint (comment fragment, branch fragment, context fragment, delivery, filter, refresh) calls CommentIndexRepository::load(), which runs an unbounded Entity Query for all comments on the node and loads every one, then runs a per-comment access check and a full tree build. Fetching one comment's fragment costs loading all 216 comments plus 216 access checks. Loading part of the tree is therefore O(total comments), not O(slice), and a single Expand All or filter run multiplies that cost by the number of requests it fires.
Steps to reproduce
- Open a node with 200+ comments under ACT.
- Request one comment fragment, e.g. /node/581/advanced-comment-threads/comment_node_blog/comment/1617/full.
- Observe the server queries and loads every comment on the node, not just the requested slice.
Proposed resolution
- Bound load() and the fragment/branch/delivery endpoints to the requested ids plus their full ancestor chains plus their direct children - 0(slice + depth), still a large win, and it preserves the ancestry access filter at CommentIndexRepository.php:158-173, which drops any comment whose parent chain contains an inaccessible comment. Bound only to the requested ids would silently remove that security control and would also break level, ancestor_ids, and child_count.
- Ensure the refresh path, which legitimately needs all ids, remains cheap (ids + metadata) and does not render every comment.
Remaining tasks
- Confirm partial-thread requests are O(slice) via a real 200+ comment thread.
User interface changes
None, beyond faster partial-thread loading.
API changes
The fragment/branch/delivery endpoints should honor an id slice = ids + ancestors + direct children, so a partial-thread request is bounded.
Data model changes
None anticipated.
Comments
Comment #2
freelockAdded context to the summary to cover the case when a comment ancestor becomes unpublished or inaccessible, to also hide all descendant comments.
Comment #4
freelockShipped in alpha3 - followon issue #3623886: Delivered comments report incorrect positions within their sibling group.
Comment #5
freelockMark it fixed!