mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 21:45:25 +08:00
Previously, "My Threads" would appear in the sidebar and drawer whenever a user was a member of a channel with threading enabled, even if they had no actual threads to view. This led to a confusing experience where clicking "My Threads" would show an empty list. The root cause was a mismatch between the visibility check (which only looked at channel membership) and the data fetch (which applied stricter filters like replies_count > 0, non-deleted messages, etc.). This introduces a shared `viewable_by_user` scope on the Thread model that both checks use, ensuring "My Threads" only appears when there are actually threads to display. The scope requires: - User has a non-muted thread membership - User is following the channel - Channel has threading enabled and is open - Thread has at least one reply - Original and last messages are not deleted To maintain a responsive UX, a MessageBus notification is sent when a user gets their first viewable thread, so "My Threads" appears in real-time without requiring a page reload. Ref - t/129094 |
||
|---|---|---|
| .. | ||
| browse_spec.rb | ||
| direct_messages_spec.rb | ||
| index_spec.rb | ||
| starred_channels_spec.rb | ||
| threads_spec.rb | ||