Opened 9 years ago
Closed 9 years ago
#6518 closed defect (bug) (fixed)
"New Comments" activity filter can cause infinite loop
Reported by: | r-a-y | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.4 | Priority: | normal |
Severity: | normal | Version: | 2.1 |
Component: | Activity | Keywords: | has-patch commit |
Cc: |
Description
Since we introduced comment syncing in 2.0, it's possible for activity comments to be attached to 'new_blog_post'
activity items.
In #5608, we wanted to expand the "New Comments" activity dropdown filter to include both old-school post comments ('new_blog_comment'
) and activity comments attached to the 'new_blog_post'
activity items.
Here's a case where good intentions went wrong :)
imath discovered that it was possible for an infinite loop to occur when the "New Comments" activity dropdown filter is used.
The bug occurs when attempting to calculate the activity comment depth (#2768).
Since the code in #2768 was meant to calculate the activity comment depth for regular activity updates, this bug never occurred before.
The attached patch checks if the parent activity is not an activity update. If the parent activity is not an activity update, we have reached the top of the tree and can bail from the recursive activity depth check.
This fixes the infinite loop problem.
Props imath for discovering this bug.
Thanks a lot r-a-y, just tested it and i confirm it's fixing the issue :)