Project

General

Profile

Actions

Feature #19846

closed

Stop doing costly Social Paper activity filters

Added by Boone Gorges 9 months ago. Updated 8 months ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Social Paper
Target version:
Start date:
2024-02-28
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Change all activity items to hide_sitewide=1:

UPDATE wp_bp_activity SET hide_sitewide = 1 WHERE type IN ('cacsp_paper_added_to_group', 'new_cacsp_comment', 'new_cacsp_edit', 'new_cacsp_paper')

then flush cache


Description

social-paper involves some complex mods to the default activity queries:

https://github.com/cuny-academic-commons/social-paper/blob/c6461a16713fe2956549552ea52ee45d814efe67/includes/hooks-buddypress-activity.php#L444

As part of recent downtime debugging, we found that a number of these sorts of activity queries were showing up in the slow query log.

Since we no longer expose Papers on the site, we should stop doing this filtering for every activity query. We can't simply disable it, though. The purpose of the filter is to provide access protection for activity items belonging to non-public papers, and removing the filter would remove this access protection. As such, I have two suggestions:

1. We switch all social-paper activity to hide_sitewide=1. This should ensure that it's not improperly exposed to anyone. The problem is that this is pretty coarse, and it means that certain people who could previously see the activity items (such as collaborators) will no longer be able to, since we'll be falling back on BP's default show_hidden logic.
2. We delete all social-paper activity, or at least the subset that's non-public. This is more foolproof but is obviously even coarser than the previous choice.

No new paper activity has been recorded since 2018, so I'm not sure that it's going to make a noticeable difference either way. Ray, what do you think?

Actions

Also available in: Atom PDF