@asti
Sure, here's a possible scenario that may help you reproduce or understand the issue:
_wpDiscuz caching is enabled
_“Use WordPress native Ajax functions” is unchecked
_A post has nested comments (threaded replies are active)
_A new comment is submitted and goes into pending moderation
_The internal method isUnapprovedInTree() returns false due to a short-circuit logic flaw
_As a result, the entire comment tree (including the pending comment) is cached and may be served to all visitors, even if they are logged out
This only occurs when:
_An unapproved comment is not in the first branch of the tree evaluated by isUnapprovedInTree()
_The comment structure is nested
_The some timing dependant of cache, fetch
Although I haven’t consistently reproduced the issue visually on the site, I was able to find cached files that contained unapproved comments using this:
From the folder of the plugin cache
grep -ari 's:16:"comment_approved";s:1:"0";' comments/
This confirms that unapproved comments can be serialized into the HTML cache.
I understand the value of being able to reproduce the issue, but in this case, the code path in isUnapprovedInTree() contains a clear logic flaw that can be reviewed directly by your development team. Providing them with the logic and fix I shared earlier may help resolve the issue without relying on uncertain reproduction steps. This would be the reason why me and @dailynous had high comment count when we observed the issue.