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

buddypress-trac noreply at wordpress.org
Mon Jun 22 19:17:07 UTC 2015


#6518: "New Comments" activity filter can cause infinite loop
----------------------------------+---------------------
 Reporter:  r-a-y                 |       Owner:  r-a-y
     Type:  defect (bug)          |      Status:  closed
 Priority:  normal                |   Milestone:  2.4
Component:  Component - Activity  |     Version:  2.1
 Severity:  normal                |  Resolution:  fixed
 Keywords:  has-patch commit      |
----------------------------------+---------------------
Changes (by r-a-y):

 * owner:   => r-a-y
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"9961"]:
 {{{
 #!CommitTicketReference repository="" revision="9961"
 Activity: When calculating the activity comment depth, prevent an infinite
 loop when the parent activity item is not an activity update.

 In #2768, we added the ability to calculate the activity comment depth.
 The code at the time was meant to calculate the activity comment depth for
 regular activity updates (`'activity_update'`).  However, it is possible
 for other activity types to have activity comments attached to them.  For
 example, since the introduction of comment syncing in 2.0, it is now
 possible for activity comments to be attached to `'new_blog_post'` items.

 When fetching activity comments attached to other activity types (as in
 the
 case when using the "New Comments" activity dropdown filter), an infinite
 loop can occur while traversing up the activity tree to calculate the
 activity comment depth.

 This commit fixes this by checking if the parent activity item is not an
 activity update during activity comment depth calculation.  If the parent
 activity is not an activity update, we have reached the top of the tree
 can
 bail from the recursive depth check.

 Fixes #6518.
 }}}

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


More information about the buddypress-trac mailing list