fix(safety): team notifications skip members who block the author #234
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/safety-team-notifications"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
#233 left one gap open. The forum hides a blocked author's threads and posts from a member, but that member was still pushed, put in the inbox and emailed about them. This closes it.
teamNotify.forumPostnow leaves out every member who blocks the post's author, and every member who blocks whoever started the thread (the forum already 404s that thread for them). The list is built once, so push, the inbox and email skip the same people. The lookup is the newuserSafety.blockersOf. A staff author is blocked by nobody (S8). If the lookup fails, the post is sent without it, because one extra notification is better than none.forumFilter: blocked authors, blocked thread starters, and the threads and posts they hid.digestPostsSincenow also returns the thread'screated_by.notifypayload carriesthreadAuthorUserId, and the controller passes it through.The Team activity feed needed nothing. #233's note named it too, but that was wrong: forum posts are never written to
team_activity. It holds membership changes, renames and a module's game events.One known lag. A game block on a Steam ID that S14 hasn't rewritten as an account block yet doesn't count for instant notifications. It starts counting the next time that member reads the forum or their blocks, which is when the rewrite happens. The digest isn't affected, because
forumFilterrewrites first.No routes changed, so the OpenAPI spec is unchanged. Docs: RunicGateway/docs, branch
docs/safety-team-notifications(USER_SAFETY.md §4.1).How it was tested
npm testinserverwith an emptyMODULES_DIR: 2387 tests, 0 failing (99 skipped).teamNotifyDispatch.test.js:userSafety.test.js:blockersOfreturns the blockers, and nobody for a staff author, a deleted account or no author.Checklist
AI-assisted contributions (required)
Claude Code (Claude Opus 5.5). I have reviewed and understandevery change, and take responsibility for it. AI-authored commits are
marked with a
Co-Authored-By/Assisted-Bytrailer.License
(GNU GPL v3.0 or later), and I have the right to contribute it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY