Skip to content

feat: move onSetUserAttributeList to BaseAttributeListener#690

Merged
denischilik merged 7 commits intoworkstation/6.0-Releasefrom
feat/migrate-set-user-attribute-list
Apr 1, 2026
Merged

feat: move onSetUserAttributeList to BaseAttributeListener#690
denischilik merged 7 commits intoworkstation/6.0-Releasefrom
feat/migrate-set-user-attribute-list

Conversation

@denischilik
Copy link
Copy Markdown

Summary

  • Declare onSetUserAttributeList on KitIntegration.BaseAttributeListener (remove from UserAttributeListener).
  • KitManagerImpl invokes BaseAttributeListener.onSetUserAttributeList when forwarding list-valued user attributes for UserAttributeListener kits.
  • Dual-interface kits (AttributeListener + UserAttributeListener): onSetUserAttributeList delegates to setUserAttributeList where applicable.
  • AttributeListener-only kits: implement onSetUserAttributeList by delegating to existing setUserAttributeList.
  • AttributeListenerTestKit implements onSetUserAttributeList for instrumented tests.

Commits

  1. Delegate onSetUserAttributeList to setUserAttributeList (dual-interface kits)
  2. Move onSetUserAttributeList to BaseAttributeListener

…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
@denischilik denischilik requested a review from a team as a code owner March 31, 2026 17:25
@cursor
Copy link
Copy Markdown

cursor bot commented Mar 31, 2026

PR Summary

Medium Risk
Medium risk because it changes the kit integration listener API surface and the forwarding path for list-valued user attributes, which could break binary/source compatibility or alter how kits receive attribute-list updates.

Overview
Unifies list-valued user attribute callbacks by moving onSetUserAttributeList onto KitIntegration.BaseAttributeListener and removing the older AttributeListener.setUserAttributeList/UserAttributeListener.onSetUserAttributeList declarations.

KitManagerImpl now forwards list-valued attributes through the single BaseAttributeListener.onSetUserAttributeList path when supportsAttributeLists() is true, otherwise it falls back to the scalar onSetUserAttribute CSV behavior. Tests and multiple kits are updated to implement the new onSetUserAttributeList signature (nullable key/list/user, List<String>), with some kits adding null-guards and Braze re-implementing list handling via the new callback.

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
- 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
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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)
}
},
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Add a consistent comment for no-op kit implementations; align AppsFlyer
wording with other kits.

Made-with: Cursor
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
72.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@denischilik denischilik requested a review from thomson-t April 1, 2026 15:10
@denischilik denischilik merged commit eca7329 into workstation/6.0-Release Apr 1, 2026
39 of 42 checks passed
@denischilik denischilik deleted the feat/migrate-set-user-attribute-list branch April 1, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants