Skip to content

Commit

Permalink
Fix de-dupe id construction
Browse files Browse the repository at this point in the history
  • Loading branch information
bsneed committed Sep 26, 2023
1 parent 164fb43 commit 4a0d0b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/TwilioEngage/TwilioEngage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public class TwilioEngage: EventPlugin {
if event.event == Events.opened.rawValue {
if var properties = event.properties?.dictionaryValue {
let formattedEventName = event.event.lowercased().replacingOccurrences(of: " ", with: "_")
let messageId = properties["message_id"] ?? UUID().toString()
let deDup_id = "\(formattedEventName)\(messageId)"
let messageId: String = properties["message_id"] as? String ?? UUID().toString()
let deDup_id = "\(messageId)\(formattedEventName)"
properties[keyPath: "dedup_id"] = deDup_id
properties[keyPath: "event_id"] = messageId
event.properties = try? JSON(properties)
Expand Down

0 comments on commit 4a0d0b9

Please sign in to comment.