[buddypress-trac] [BuddyPress Trac] #7534: Remove read notifications from the DB table after a specified time period

buddypress-trac noreply at wordpress.org
Sun Jul 21 13:40:14 UTC 2024


#7534: Remove read notifications from the DB table after a specified time period
-------------------------------------------------+-------------------------
 Reporter:  r-a-y                                |       Owner:
                                                 |  espellcaste
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  15.0.0
Component:  Performance                          |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback needs-unit-tests        |
  needs-refresh                                  |
-------------------------------------------------+-------------------------
Changes (by espellcaste):

 * keywords:  dev-feedback has-patch => dev-feedback needs-unit-tests needs-
     refresh


Comment:

 I've been thinking about this ticket and this is what I think.

 The original source of the problem was a large site where keeping millions
 notifications in the database were not desired. But we should not assume
 this should be the default behavior for every BuddyPress ''site''.

 I agree with @johnjamesjacoby here that we should not remove those
 notifications by default. Without end users acknowledgement. Or the
 community's owner, since [https://core.trac.wordpress.org/ticket/61598
 most of them will be unaware].

 With trash posts, a limited number of users perform the removal action
 (editors inside WordPress). And the intent of the action, trashing a post,
 is different from having read a notification. A notification record can
 have any type of content that a user might want to reach back.

 The option to show/hide, or delete, them to the user, depends a lot on the
 decision of the community's owner. It could be performance, retention
 policy (legal), analytics, etc.

 --

 To me, the removal of notifications should work similarly to the way
 [https://wordpress.org/documentation/article/revisions/ WordPress removes
 revisions]. So here is what I suggest:

 1. Allow an unlimited number of notifications to be saved in the database
 by default.
  - Let's confirm if this page is paginated:
 {{{https://site.test/members/user/notifications/read/}}}
 2. Add option to limit the number of notifications per user that's saved
 in the database.
  - A custom CLI command to remove the ^ notifications using a bulk task;
  - A cron job that uses ^ this command and runs in a filterable schedule
 (weekly by default;
  - An indication here about the retention limit:
 {{{https://site.test/members/user/notifications/read/}}}

 I think a CLI command is better here because it'll perform the removal in
 a better way than the current patch. Looping notifications, handle
 failures, can be fired without a cron job too (for those sites that rely
 on WP CLI), can be used in cron jobs, etc.

 Thoughts?!

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7534#comment:13>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list