Skip to:

Opened 17 months ago

Last modified 2 weeks ago

#8296 new defect (bug)

`bp_activity_comments` cache should purge when an any child `activity_comment` is marked as spam

Reported by: oztaser Owned by:
Milestone: 10.0.0 Priority: normal
Severity: normal Version:
Component: Activity Keywords: has-patch needs-unit-tests


We need to purge the parent activity bp_activity_comments cache when an activity comment marked as spam.

Steps to Reproduce:

  1. Enable object cache
  2. Add an activity comment to any activity
  3. Go to activity list page on admin
  4. Find an activity comment and marked as a spam
  5. Go back to activity page and see activity comment is still there

Attachments (2)

8296.patch (647 bytes) - added by oztaser 17 months ago.
8296.2.patch (2.6 KB) - added by imath 2 weeks ago.

Download all attachments as: .zip

Change History (6)

17 months ago

#1 @imath
3 weeks ago

  • Keywords reporter-feedback added

Hi @oztaser

I'm wondering, shouldn't we purge cache for any type of activity marked as spam ? Why restricting this to activity comment ?

#2 @oztaser
3 weeks ago

  • Keywords reporter-feedback removed

Hi @imath,

What I suggested here in this ticket is purging activity_comments cache. If you add activity comment to A activity and then mark as spam your activity comment, activity_comments cache of A activity needs to purge.

Based on your point we're already purging caches when activity marked as spam, If I don't missing something.

I took an another look at my patch, It does't look perfect :). We may purge $activity->item_id cache in bp_activity_mark_as_spam function.

2 weeks ago

#3 @imath
2 weeks ago

  • Keywords has-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to 10.0.0

Hi @oztaser

Thanks for your explanations. I think we need to review how the bp_activity and bp_activity_comments cache are purged. Imho, when an activity is marked as spam/ham we should probably also purge the bp_activity cache if the activity is not an activity comment.

I also think we should take your patch in account, but avoid checking for is_spam as a comment content can simply be updated by the Administrator from the Activity Administration screen.

I'd feel more secure if we could build some unit tests about these purges.

I'd also like to get feedback about it from @r-a-y as he's been working on this area in the past.

Last edited 2 weeks ago by imath (previous) (diff)

#4 @oztaser
2 weeks ago

Hi @imath,

Thanks for your work. I totally agree with you and your patch looks good to me.

Note: See TracTickets for help on using tickets.