Skip to content

Commit 8ff8dca

Browse files
committed
Bettering the dedup for our emails
1 parent 71a246d commit 8ff8dca

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/models/pager_tree/integrations/email/v3.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ def _thirdparty_id
7777
end
7878

7979
def _dedup_keys
80-
keys = [_thirdparty_id]
81-
keys.concat(Array(_mail.references)) if option_dedup_threads
82-
keys
80+
keys = []
81+
82+
if option_dedup_threads
83+
keys.concat(Array(_thirdparty_id))
84+
keys.concat(Array(_mail.references))
85+
end
86+
87+
keys.compact_blank.uniq
8388
end
8489

8590
def _title

scripts/test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dotenv -f .env.test.local bundle exec rails test

0 commit comments

Comments
 (0)