Commit ac288a1
committed
fix(audience): truncate string values inside properties/traits dicts
Top-level fields (eventName, anonymousId, userId, identityType,
fromId/fromType/toId/toType) were being truncated to
Constants.MaxFieldLength, but string values inside the
caller-supplied properties dict and traits dict were not. This left
typed-event fields (Progression.World, Purchase.ItemName,
MilestoneReached.Name, etc.) and custom-event property values
un-truncated - so a caller passing a 10MB string through an IEvent
impl or Track(string, Dictionary) would ship the full string to the
backend.
Adds MessageBuilder.TruncateStringValues, called on properties
inside Track() and on traits inside Identify() just before
assigning to the outgoing msg. Mutates the dict in place (caller
owns fresh or snapshotted dicts at this point - no shared-state
hazard). Non-string values are left untouched.
Alias doesn't carry a properties/traits dict so no change there.1 parent 120f890 commit ac288a1
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
93 | 110 | | |
94 | 111 | | |
0 commit comments