Skip to content

Avoid making silent thread followers pingable (for privacy) - #2176

Open
trichoplax wants to merge 4 commits into
developfrom
trichoplax/avoid-adding-thread-followers-to-pingable
Open

trichoplax wants to merge 4 commits into
developfrom
trichoplax/avoid-adding-thread-followers-to-pingable

Conversation

@trichoplax

Copy link
Copy Markdown
Contributor

By intention, only moderators have access to view the list of followers of a comment thread. However, including silent thread followers (those who have no interaction with the thread or post or answers other than following the thread) in the list of pingable users currently leaks this information to any user.

Since there is no reason to be able to ping a user who has no connection to the thread, this change removes silent thread followers from the list of pingable users.

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.26%. Comparing base (9602fd4) to head (b55c8cf).

Additional details and impacted files
Components Coverage Δ
controllers 78.12% <ø> (ø)
helpers 85.62% <ø> (ø)
jobs 79.93% <ø> (ø)
models 93.56% <ø> (ø)
tasks 61.11% <ø> (ø)
scripts ∅ <ø> (∅)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cellio

cellio commented Nov 13, 2026

Copy link
Copy Markdown
Member

Does the "notify for new comments" logic run through the pingable method that this PR changes?Or is that done in a different way?

@trichoplax

Copy link
Copy Markdown
Contributor Author

Does the "notify for new comments" logic run through the pingable method that this PR changes?Or is that done in a different way?

Good question. In the CommentsController, both create_thread and create (to create a comment in an existing thread) call check_for_pings which relies on the pingable method that is being modified here. Also, update, which deals with editing an existing comment, calls the same check_for_pings when deciding if a new ping is needed following the edit.

So I believe all the ways of causing a ping will now only regard a user as pingable if they are an editor of the post, or the author of the post, an answer, or a comment on the post.

@cellio

cellio commented Nov 13, 2026

Copy link
Copy Markdown
Member

Sorry, I'm still confused. Will non-participant thread followers continue to receive notifications with this change? (Do we have a test case for that?)

@trichoplax

Copy link
Copy Markdown
Contributor Author

Sorry, I'm still confused. Will non-participant thread followers continue to receive notifications with this change?

This shouldn't affect non-ping-mention notifications to thread followers, only whether thread followers are available to be directly pinged.

To clarify: Here "pingable" means "can be @-mentioned", rather than "can be notified". It's asking who the comment author can choose to ping, rather than who the system can send notifications to.

(Do we have a test case for that?)

Good catch. We do not as far as I can see (let me know if I've overlooked an existing one). I've added one now.

@trichoplax

Copy link
Copy Markdown
Contributor Author

Since it has caused confusion here, it might be worth renaming the existing pingable method to make it less ambiguous. Would something like at-mentionable work? Any suggestions of a better name?

@cellio

cellio commented Nov 13, 2026

Copy link
Copy Markdown
Member

Since it has caused confusion here, it might be worth renaming the existing pingable method to make it less ambiguous. Would something like at-mentionable work? Any suggestions of a better name?

I don't think we need to rename the function. The meaning of ping is clear; I just wanted to check that our code didn't bake in any assumptions about who gets notifications -- I could imagine a code path that calls pingable for a list, so we don't ping authors who've unfollowed, and just want to check that we're not doing that. I assume not, since we have the thread_followers table now. And thanks for the test case to prove it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants