PERF: Async notify users after inviting group (#12697)

Inviting a group generates a notification for each member. If this
happens synchronously it may take a while, leading to a poor user
experience.
This commit is contained in:
Dan Ungureanu
2021-04-14 19:30:51 +03:00
committed by GitHub
parent 8c24a848e0
commit 99dadb2129
4 changed files with 45 additions and 31 deletions

View File

@@ -982,6 +982,7 @@ describe Topic do
set_state!(group, user_muted, :muted)
Notification.delete_all
Jobs.run_immediately!
topic.invite_group(topic.user, group)
expect(Notification.count).to eq(3)

View File

@@ -281,6 +281,7 @@ describe TopicUser do
another_user = Fabricate(:user)
group.add(another_user)
Jobs.run_immediately!
topic.invite_group(target_user, group)
expect(TopicUser.get(topic, another_user).notification_level)