Opened 13 years ago
Closed 11 years ago
#4327 closed defect (bug) (duplicate)
My Favorites Count Bug
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.5.6 |
Component: | Activity | Keywords: | |
Cc: |
Description
Here is a scenario that isn't covered in BuddyPress:
Create an activity(about anything).
Mark it as Favorite
Remove the activity.
Now the favorite count will remain the same since there is nothing handling activity deletion with the fav count reduction in the user meta.
I hope this gets fixed soon, as the previous bug I reported.
Change History (3)
#2
@
13 years ago
- Milestone changed from Awaiting Review to Future Release
See #3794.
The idea of duplicating favorites data in usermeta and activitymeta is not very appealing - it introduces the possibility of getting something out of sync. A far better solution is for Favorites to be stored in a proper lookup table, either as a true Activity add-on, or as a standalone component.
I think this problem can be fixed by having a meta data in the activity containing the ids of the users who marked it as favorite(just like user meta is having all the ids of the activities they've marked favorite, sort of like reverse mapping).
Then on deletion we can remove the favorites from all the users for that activity in just two queries(one for removing the activity id from all users and one for decrementing the count).