mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 01:15:26 +08:00
DEV: Centralize user updates to a single MessageBus channel. (#17058)
Introduces an interface to publish user updates on the server side and helps to reduce the growing number of subscriptions on the client side.
This commit is contained in:

committed by
GitHub

parent
bd32656157
commit
94c3bbc2d1
@ -174,9 +174,9 @@ describe PostCreator do
|
||||
"/latest",
|
||||
"/topic/#{created_post.topic_id}",
|
||||
"/topic/#{created_post.topic_id}",
|
||||
"/user-drafts/#{admin.id}",
|
||||
"/user-drafts/#{admin.id}",
|
||||
"/user-drafts/#{admin.id}",
|
||||
User.publish_updates_channel(admin.id),
|
||||
User.publish_updates_channel(admin.id),
|
||||
User.publish_updates_channel(admin.id),
|
||||
].sort
|
||||
)
|
||||
|
||||
@ -205,7 +205,7 @@ describe PostCreator do
|
||||
user_action = messages.find { |m| m.channel == "/u/#{p.user.username}" }
|
||||
expect(user_action).not_to eq(nil)
|
||||
|
||||
draft_count = messages.find { |m| m.channel == "/user-drafts/#{p.user_id}" }
|
||||
draft_count = messages.find { |m| m.channel == User.publish_updates_channel(p.user_id) }
|
||||
expect(draft_count).not_to eq(nil)
|
||||
|
||||
expect(messages.filter { |m| m.channel != "/distributed_hash" }.length).to eq(7)
|
||||
|
Reference in New Issue
Block a user