feat: move onSetUserAttributeList to BaseAttributeListener#690
Conversation
…ce kits) Braze, AppsFlyer, and Singular implement both AttributeListener and UserAttributeListener; wire empty onSetUserAttributeList to existing setUserAttributeList behavior. Made-with: Cursor
- Declare onSetUserAttributeList on BaseAttributeListener; remove from UserAttributeListener. - KitManagerImpl calls BaseAttributeListener.onSetUserAttributeList for list attributes. - AttributeListener-only kits delegate onSetUserAttributeList to setUserAttributeList. - AttributeListenerTestKit implements onSetUserAttributeList via setUserAttributeList. Made-with: Cursor
PR SummaryMedium Risk Overview
Written by Cursor Bugbot for commit fdd973b. This will update automatically on new commits. Configure here. |
KitManagerImpl forwards list-valued attributes via BaseAttributeListener.onSetUserAttributeList when supportsAttributeLists is true. Made-with: Cursor
- Drop legacy two-arg setUserAttributeList from KitIntegration.AttributeListener; KitManagerImpl already forwards list attributes via onSetUserAttributeList. - Kits: use private helpers (Braze, Localytics) or inline no-ops; Adobe kits call syncIds from onSetUserAttributeList only. - AttributeListenerTestKit invokes list callback from onSetUserAttributeList. Made-with: Cursor
android-kit-base/src/main/java/com/mparticle/kits/KitIntegration.java
Outdated
Show resolved
Hide resolved
- Braze: remove private setUserAttributeList; duplicate Braze getCurrentUser flow in onSetUserAttributeList and setAllUserAttributes initial sync. - Localytics: call Localytics.setProfileAttribute directly from onSetUserAttributeList and setAllUserAttributes. Made-with: Cursor
Rename Kotlin overrides and call sites to use attributeKey, attributeValueList, and user consistently across kits and test kits. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| Logger.warning("unable to set key: " + key + " with User Attribute List: " + value) | ||
| } | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Duplicated Braze API logic instead of delegating to method
Medium Severity
setAllUserAttributes inlines the full Braze getCurrentUser callback pattern (~15 lines) instead of delegating to onSetUserAttributeList(key, value, null), which contains the identical logic. The old code avoided this by calling setUserAttributeList(key, value). Since key and value from the map are non-null, the null guard in onSetUserAttributeList will pass, and the user parameter is unused — making delegation safe and removing a significant maintenance risk across all four Braze kit versions.
Additional Locations (2)
Add a consistent comment for no-op kit implementations; align AppsFlyer wording with other kits. Made-with: Cursor
|




Summary
onSetUserAttributeListonKitIntegration.BaseAttributeListener(remove fromUserAttributeListener).KitManagerImplinvokesBaseAttributeListener.onSetUserAttributeListwhen forwarding list-valued user attributes forUserAttributeListenerkits.onSetUserAttributeListdelegates tosetUserAttributeListwhere applicable.onSetUserAttributeListby delegating to existingsetUserAttributeList.AttributeListenerTestKitimplementsonSetUserAttributeListfor instrumented tests.Commits