Thanks for the report. Nice investigation as well. You've dug, and then reached a quite obscure corner of confluence-xml.
The given information is not nearly enough for studying the issue, a reproduction case would be needed.
However, I have possibly good news for you: we got a report of a very similar issue, maybe it's the same thing? I stole your "endless loop" phrasing. See https://jira.xwiki.org/browse/CONFLUENCE-534
I'll make a release shortly so you can check if this solves your issue as well.
Raphaël Jakse on 06/Aug/26 14:16
> Also not sure if the following can happen: If listenerToRemove is the one currently wrapped by this, but queuedListeners is not empty after the loop, it will not be replaced by the compositeListener, and will stay wrapped even though it's not contained in queuedListeners any more.
That's exactly what's causing the endless loop in CONFLUENCE-534, so congrats on identifying this.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.