FIX: Dismissing unread posts did not publish changes to other clients (#22584)

Why this change?

Prior to this change, dismissing unreads posts did not publish the
changes across clients for the same user. As a result, users can end up
seeing an unread count being present but saw no topics being loaded when
visiting the `/unread` route.
This commit is contained in:
Alan Guo Xiang Tan
2023-07-13 18:05:56 +08:00
committed by GitHub
parent ab6c638da2
commit 48c8ed49d6
9 changed files with 208 additions and 40 deletions

View File

@@ -1100,11 +1100,12 @@ class TopicsController < ApplicationController
dismissed_topic_ids = []
dismissed_post_topic_ids = []
if !current_user.new_new_view_enabled? || params[:dismiss_topics]
dismissed_topic_ids =
TopicsBulkAction.new(current_user, topic_scope.pluck(:id), type: "dismiss_topics").perform!
TopicTrackingState.publish_dismiss_new(current_user.id, topic_ids: dismissed_topic_ids)
end
if params[:dismiss_posts]
if params[:untrack]
dismissed_post_topic_ids =