Commit e5f50e4
authored
feat: Migrate setUserAttribute (#689)
* feat: align onSetUserAttribute with UserAttributeListener (nullable params, naming)
- SingularKit: key/value/user naming, null checks for Java interop
- AppsFlyerKit, Braze AppboyKit: consistent UserAttributeListener overrides
Made-with: Cursor
* feat: move onSetUserAttribute to BaseAttributeListener
- KitIntegration: declare onSetUserAttribute on BaseAttributeListener; remove from UserAttributeListener
- KitManagerImpl: dispatch scalar and CSV list paths via BaseAttributeListener; avoid double calls for dual-interface kits
- AttributeListener-only kits: delegate onSetUserAttribute to setUserAttribute
- AttributeListenerTestKit: implement onSetUserAttribute
Made-with: Cursor
* Remove setUserAttribute from AttributeListener; route via onSetUserAttribute
- Drop setUserAttribute from KitIntegration.AttributeListener; kits keep
setUserAttribute as a regular method (no override).
- KitManagerImpl: use BaseAttributeListener.onSetUserAttribute for scalar and
joined list paths; prefer UserAttributeListener when both interfaces apply.
- AttributeListenerTestKit: rename callback to setUserAttributeCallback;
update DataplanBlockingUserTests.
Made-with: Cursor
* Inline user attribute handling in onSetUserAttribute; remove kit setUserAttribute
- Move scalar attribute logic from removed setUserAttribute helpers into
onSetUserAttribute (or private helpers shared with setAllUserAttributes).
- Braze: applyScalarUserAttribute for onSet + initial sync; update unit tests
to call onSetUserAttribute with a mocked FilteredMParticleUser.
- AttributeListenerTestKit: inline callback/onAttributeReceived in
onSetUserAttribute.
Made-with: Cursor
* KitManagerImpl: restore AttributeListener before UserAttributeListener for list attrs
Re-run both branches when a kit implements both interfaces; UserAttributeListener
join path calls UserAttributeListener.onSetUserAttribute again.
Made-with: Cursor
* Braze kit: extract scalar user attribute branches into helpers
Split applyScalarUserAttribute into applyScalarUserAttributeOnUser plus
focused helpers for age, email/push subscribe, gender, subscription groups,
and unmapped custom keys (braze-38 through braze-41).
Made-with: Cursor
* KitManagerImplTest: verify onSetUserAttribute for list-as-CSV path
AttributeListener no longer has setUserAttribute; assert BaseAttributeListener
onSetUserAttribute with joined value and FilteredMParticleUser.
Made-with: Cursor
* KitManagerImplTest: expect null FilteredMParticleUser in list CSV verify
FilteredMParticleUser.getInstance returns null in JVM unit tests; Mockito
any(Class) does not match null. Use isNull() for the third onSetUserAttribute arg.
Made-with: Cursor
* Align onSetUserAttribute Kotlin overrides with nullable key and value
- Use String? and Any? for parameters matching Java Object/null call paths
- Add early returns when key or value is null where needed
- CleverTap: rename parameters to key/value; use mappedKey/mappedValue for mutations
Made-with: Cursor
* Use nullable FilteredMParticleUser in onSetUserAttribute overrides
Third parameter is user: FilteredMParticleUser? to match KitManagerImpl and
FilteredMParticleUser.getInstance. GA/GA4 use parameter name user.
Made-with: Cursor1 parent 9d07e1c commit e5f50e4
27 files changed
Lines changed: 642 additions & 451 deletions
File tree
- android-kit-base/src
- androidTest/kotlin/com/mparticle/kits
- testkits
- main/java/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- kits
- adobemedia/adobemedia-5/src/main/kotlin/com/mparticle/kits
- adobe/adobe-5/src/main/kotlin/com/mparticle/kits
- appsflyer/appsflyer-6/src/main/kotlin/com/mparticle/kits
- apptimize/apptimize-3/src/main/kotlin/com/mparticle/kits
- branch/branch-5/src/main/kotlin/com/mparticle/kits
- braze
- braze-38/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- braze-39/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- braze-40/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- braze-41/src
- main/kotlin/com/mparticle/kits
- test/kotlin/com/mparticle/kits
- clevertap/clevertap-7/src/main/kotlin/com/mparticle/kits
- comscore/comscore-6/src/main/kotlin/com/mparticle/kits
- ga4/ga4-23/src/main/kotlin/com/mparticle/kits
- ga/ga-23/src/main/kotlin/com/mparticle/kits
- kochava/kochava-5/src/main/kotlin/com/mparticle/kits
- leanplum/leanplum-7/src/main/kotlin/com/mparticle/kits
- localytics/localytics-6/src/main/kotlin/com/mparticle/kits
- singular/singular-12/src/main/kotlin/com/mparticle/kits
- urbanairship/urbanairship-20/src/main/kotlin/com/mparticle/kits
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 44 | | |
53 | 45 | | |
54 | 46 | | |
| |||
70 | 62 | | |
71 | 63 | | |
72 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
390 | 399 | | |
391 | 400 | | |
392 | 401 | | |
393 | 402 | | |
394 | | - | |
395 | | - | |
396 | 403 | | |
397 | 404 | | |
398 | 405 | | |
| |||
556 | 563 | | |
557 | 564 | | |
558 | 565 | | |
559 | | - | |
560 | | - | |
561 | 566 | | |
562 | 567 | | |
563 | 568 | | |
| |||
Lines changed: 8 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
| 688 | + | |
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
692 | | - | |
| 693 | + | |
693 | 694 | | |
694 | 695 | | |
695 | 696 | | |
696 | 697 | | |
697 | | - | |
| 698 | + | |
698 | 699 | | |
699 | | - | |
| 700 | + | |
700 | 701 | | |
701 | 702 | | |
702 | 703 | | |
703 | 704 | | |
704 | 705 | | |
705 | 706 | | |
706 | | - | |
| 707 | + | |
707 | 708 | | |
708 | 709 | | |
709 | 710 | | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
| 711 | + | |
716 | 712 | | |
717 | 713 | | |
718 | 714 | | |
| |||
745 | 741 | | |
746 | 742 | | |
747 | 743 | | |
748 | | - | |
749 | | - | |
| 744 | + | |
| 745 | + | |
750 | 746 | | |
751 | 747 | | |
752 | 748 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
557 | 560 | | |
558 | 561 | | |
559 | 562 | | |
560 | | - | |
561 | | - | |
| 563 | + | |
| 564 | + | |
562 | 565 | | |
563 | 566 | | |
564 | 567 | | |
| |||
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 51 | | |
59 | 52 | | |
60 | 53 | | |
| |||
78 | 71 | | |
79 | 72 | | |
80 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| |||
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 88 | | |
96 | 89 | | |
97 | 90 | | |
| |||
115 | 108 | | |
116 | 109 | | |
117 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | 251 | | |
257 | 252 | | |
258 | 253 | | |
| |||
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | 124 | | |
132 | 125 | | |
133 | 126 | | |
| |||
148 | 141 | | |
149 | 142 | | |
150 | 143 | | |
151 | | - | |
| 144 | + | |
152 | 145 | | |
153 | 146 | | |
154 | 147 | | |
| |||
159 | 152 | | |
160 | 153 | | |
161 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
| |||
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | 177 | | |
183 | 178 | | |
184 | 179 | | |
| |||
198 | 193 | | |
199 | 194 | | |
200 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
201 | 204 | | |
202 | 205 | | |
203 | 206 | | |
| |||
0 commit comments