Skip to content

Commit 6a1283f

Browse files
committed
test: sort the object keys to prevent intermittent failures
1 parent b539c83 commit 6a1283f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

processor/consent.go

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package processor
22

33
import (
44
"fmt"
5+
"sort"
56
"strings"
67

78
"github.com/samber/lo"
@@ -261,7 +262,9 @@ func getConsentManagementInfo(event types.SingularEventT) (ConsentManagementInfo
261262
consentManagementInfo.AllowedConsentIDs = val
262263
case map[string]interface{}:
263264
// Use keys from the map (legacy OneTrust format)
265+
// Also, sort the keys
264266
consentManagementInfo.AllowedConsentIDs = lo.Keys(val)
267+
sort.Strings(consentManagementInfo.AllowedConsentIDs)
265268
default:
266269
consentManagementInfo.AllowedConsentIDs = []string{}
267270
}

0 commit comments

Comments
 (0)