Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 8 years ago

#2082 closed defect (bug) (fixed)

Activity: @mentions (atme) displays new count - if activity with mention was deleted

Reported by: nuprn1 Owned by:
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Activity Keywords:
Cc:

Description

Create an @username mention with one user
delete activity

log in as mentioned user - under the main Activity component the counter displays 1 new (when no atme activity is present) but under the profile > activity subnav - no counter is displayed.

Change History (4)

#1 @boonebgorges
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3468]) Decreases new mention count when activity items are deleted. Fixes #2082

#2 @boonebgorges
8 years ago

  • Component set to Activity
  • Priority changed from major to normal
  • Resolution fixed deleted
  • Status changed from closed to reopened

I was just poking around and I realized that this solution is flawed. Deleting an activity item with a mention will reduce the mention count, whether or not the mentioned user has viewed the item. This comes about because new_mention_count is stored as a dumb integer - it doesn't know which mentions it refers to.

I think that the proper fix is probably to add a usermeta along the lines of new_mentions, which keeps track of specific activity_ids in an array. new_mention_count can be maintained for backward compatibility. But deleting activity items (or adding new mentions) will no longer simply increment this number. Instead, the activity_id of the new/deleted item will be compared against activity_ids, removed or added as necessary, and new_mention_count will be set as count( $new_mentions ). This is about as good as we can do, given that mention data is not stored separately in the db.

#3 @boonebgorges
8 years ago

Gee whiz, nothing is ever easy. I had to do some trickery to get this to work.

#4 @boonebgorges
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4367]) Reconfigures the way that new activity mentions are stored and incremented, so that counts more accurately reflect new and deleted activity items. Fixes #2082

Note: See TracTickets for help on using tickets.