FIX: delay chat notify watching job (#28386)

This change delays the notify watching job to allow time for message to be marked as seen within chat.

Without a slight delay the job fires straight away and often means that messages are seen on screen but the user also receives a notification due to Chat::Notifier.user_has_seen_message? returning false.
This commit is contained in:
David Battersby 2024-08-15 18:08:30 +04:00 committed by GitHub
parent 060933d064
commit e16f22c372
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -370,7 +370,8 @@ module Chat
end
def notify_watching_users(except: [])
Jobs.enqueue(
Jobs.enqueue_in(
5.seconds,
Jobs::Chat::NotifyWatching,
{ chat_message_id: @chat_message.id, except_user_ids: except, timestamp: @timestamp.to_s },
)