fix: Update flaky notification tests (#1728)

This commit is contained in:
Pranav Raj S
2021-02-03 17:55:27 +05:30
committed by GitHub
parent 5d5e75ce9c
commit 7748e0c56e
3 changed files with 10 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ const TWITTER_HASH_REGEX = /(^|\s)#(\w+)/g;
const TWITTER_HASH_REPLACEMENT =
'$1<a href="https://twitter.com/hashtag/$2" target="_blank" rel="noreferrer nofollow noopener">#$2</a>';
const USER_MENTIONS_REGEX = /mention:\/\/(user|team)\/(\d+)\/([\w\s]+)/gm;
const USER_MENTIONS_REGEX = /mention:\/\/(user|team)\/(\d+)\/(.+)/gm;
class MessageFormatter {
constructor(message, isATweet = false) {

View File

@@ -56,7 +56,8 @@ class NotificationListener < BaseListener
def generate_notifications_for_mentions(message, account)
return unless message.private?
mentioned_ids = message.content.scan(%r{\(mention://(user|team)/(\d+)/([\w\s]+)\)}).map(&:second).uniq
mentioned_ids = message.content.scan(%r{\(mention://(user|team)/(\d+)/(.+)\)}).map(&:second).uniq
return if mentioned_ids.blank?
get_valid_mentioned_ids(mentioned_ids, message.inbox).each do |user_id|