[buddypress-trac] [BuddyPress Trac] #6518: "New Comments" activity filter can cause infinite loop

buddypress-trac noreply at wordpress.org
Sat Jun 20 20:12:33 UTC 2015


#6518: "New Comments" activity filter can cause infinite loop
----------------------------------+-----------------------
 Reporter:  r-a-y                 |      Owner:
     Type:  defect (bug)          |     Status:  new
 Priority:  normal                |  Milestone:  2.4
Component:  Component - Activity  |    Version:  2.1
 Severity:  normal                |   Keywords:  has-patch
----------------------------------+-----------------------
 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.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6518>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list