Project

General

Profile

Actions

Feature #19846

closed

Stop doing costly Social Paper activity filters

Added by Boone Gorges 2 months ago. Updated about 2 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 #1

Updated by Raymond Hoh 2 months ago

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.

Yeah, that's true. Since we no longer have a social paper activity options filter on a user's "Commons Profile > Activity" page, it is hard right now to even view social paper activity items in the feed without manually clicking "Load More" forever. Let's do point 1. If users still kept their social paper email or BP notifications, then it's still possible to view those papers. Also, the main Papers directory page has various tabs like "My Papers" and "Papers I Follow", but the user would need to know about that directory page since we no longer display it in the site nav.

Actions #2

Updated by Boone Gorges 2 months ago

  • Status changed from New to Staged for Production Release
  • Deployment actions updated (diff)

Thanks for confirming, Ray. I've gone the ultra-cautious route and made the necessary mods in our own social-paper customizations rather than in social-paper itself. https://github.com/cuny-academic-commons/cac/commit/9a9e7ebf4cf6e47cecc5639e4c7516d67614b24c I've also updated my deployment notes so that I make the necessary database changes.

Actions #3

Updated by Boone Gorges about 2 months ago

  • Status changed from Staged for Production Release to Resolved
Actions

Also available in: Atom PDF