Skip to:
Content

BuddyPress.org

Opened 2 months ago

Closed 4 weeks ago

#9096 closed defect (bug) (fixed)

Data Loss Issue: Last Activity Deletion impact Member Directory and Friend List due to Repair member "last activity" data.

Reported by: vapvarun's profile vapvarun Owned by: imath's profile imath
Milestone: 12.4.0 Priority: normal
Severity: normal Version: 2.0
Component: Activity Keywords: has-patch
Cc:

Description

The bp_last_activity_migrate() function, designed to migrate last_activity data from the usermeta table to the bp_activity table, inadvertently leads to data loss. This occurs because the function first deletes existing last_activity data from the bp_activity table to avoid duplicates. However, since last_activity is no longer saved in the usermeta, this permanently loses last_activity information.

https://github.com/buddypress/buddypress/blob/41d7e95513c7c1441fc94e254333be2cb9abb80e/src/bp-members/bp-members-functions.php#L1220

Two other people also have reported the same issue here https://buddypress.org/support/topic/unexpected-behaviour-with-friends-list-default-sorting/

We can also remove this option https://prnt.sc/ETlX7PjRMb-b

Change History (10)

This ticket was mentioned in Slack in #buddypress by vapvarun. View the logs.


2 months ago

#2 @imath
2 months ago

  • Component changed from Core to Activity
  • Milestone changed from Awaiting Review to 14.0.0

Ouch! That's pretty annoying

#3 @imath
8 weeks ago

  • Owner set to imath
  • Status changed from new to assigned

This ticket was mentioned in Slack in #buddypress by vapvarun. View the logs.


4 weeks ago

#5 @imath
4 weeks ago

  • Milestone changed from 14.0.0 to 12.4.0

#6 @imath
4 weeks ago

  • Keywords needs-patch added
  • Version set to 2.0

This ticket was mentioned in PR #258 on buddypress/buddypress by imath.


4 weeks ago
#7

  • Keywords has-patch added; needs-patch removed

This tool was designed to be used in case a last_activity user meta migration went wrong during 2.0.0 uprade process. Since this version we stopped using this user meta in favor of a logging "hidden" activity entry.

As bp_admin_repair_last_activity() now only remove all trace of last active members without regenarating it. We are deprecating and stop using this function.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/9096

#8 @imath
4 weeks ago

In 13775:

Remove the tool to repair the members last activity tracker

In version 2.0 we decided to stop using the last_activity user meta in favor of tracing this information as an activity type having the same name. Meaning we stopped inserting this user meta for new members or any member of a community if the first BuddyPress installed version is upper than 1.9.

When upgrading from a version < 2.0 to the 2.0 version, the bp_last_activity_migrate() function is there to use the user meta to populate the activity table with corresponding last_activity activities.

We also created a repair tool in case the above upgrade task failed. This tool became obsolete but we forgot to remove it. It's now very problematic if an Admin user uses this tool as it will delete all last_activity activities but will fail at finding users having the last_activity meta.

To stop the spread, we decided to remove this tool during a minor release (12.4.0) as we felt it was an emergency.

Props vapvarun

See #9096 (trunk)

#10 @imath
4 weeks ago

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

In 13776:

Remove the tool to repair the members last activity tracker

In version 2.0 we decided to stop using the last_activity user meta in favor of tracing this information as an activity type having the same name. Meaning we stopped inserting this user meta for new members or any member of a community if the first BuddyPress installed version is upper than 1.9.

When upgrading from a version < 2.0 to the 2.0 version, the bp_last_activity_migrate() function is there to use the user meta to populate the activity table with corresponding last_activity activities.

We also created a repair tool in case the above upgrade task failed. This tool became obsolete but we forgot to remove it. It's now very problematic if an Admin user uses this tool as it will delete all last_activity activities but will fail at finding users having the last_activity meta.

To stop the spread, we decided to remove this tool during a minor release (12.4.0) as we felt it was an emergency.

Props vapvarun

Fixes #9096 (branch 12.0)

Note: See TracTickets for help on using tickets.