mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 02:58:48 +08:00
PERF: Move user-tips and narrative to per-user messagebus channels (#19773)
Using a shared channel with per-message permissions means that every client is updated with the channel's 'last_id', even if there are no messages available to them. Per-user channel names avoid this problem - the last_id will only be incremented when there is a message for the given user.
This commit is contained in:
@ -551,7 +551,7 @@ RSpec.describe UserUpdater do
|
||||
context "when skip_new_user_tips is edited" do
|
||||
it "updates seen_popups too" do
|
||||
messages =
|
||||
MessageBus.track_publish("/user-tips") do
|
||||
MessageBus.track_publish("/user-tips/#{user.id}") do
|
||||
UserUpdater.new(Discourse.system_user, user).update(skip_new_user_tips: true)
|
||||
end
|
||||
|
||||
@ -573,7 +573,7 @@ RSpec.describe UserUpdater do
|
||||
context "when seen_popups is edited" do
|
||||
it "publishes a message" do
|
||||
messages =
|
||||
MessageBus.track_publish("/user-tips") do
|
||||
MessageBus.track_publish("/user-tips/#{user.id}") do
|
||||
UserUpdater.new(Discourse.system_user, user).update(seen_popups: [1])
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user