Opened 5 years ago
Closed 3 years ago
#8296 closed defect (bug) (fixed)
`bp_activity_comments` cache should purge when an any child `activity_comment` is marked as spam
Reported by: | oztaser | Owned by: | imath |
---|---|---|---|
Milestone: | 10.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | has-patch has-unit-tests commit |
Cc: |
Description
We need to purge the parent activity bp_activity_comments
cache when an activity comment marked as spam.
Steps to Reproduce:
- Enable object cache
- Add an activity comment to any activity
- Go to activity list page on admin
- Find an activity comment and marked as a spam
- Go back to activity page and see activity comment is still there
Attachments (3)
Change History (9)
#2
@
3 years 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.
#3
@
3 years 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.
#4
@
3 years ago
Hi @imath,
Thanks for your work. I totally agree with you and your patch looks good to me.
Hi @oztaser
I'm wondering, shouldn't we purge cache for any type of activity marked as spam ? Why restricting this to activity comment ?