Skip to content

feat: split LogoutListener from AttributeListener#685

Open
denischilik wants to merge 10 commits intoworkstation/6.0-Releasefrom
feat/remove-attribute-listener
Open

feat: split LogoutListener from AttributeListener#685
denischilik wants to merge 10 commits intoworkstation/6.0-Releasefrom
feat/remove-attribute-listener

Conversation

@denischilik
Copy link
Copy Markdown

Summary

  • Introduces KitIntegration.LogoutListener as a separate contract from the deprecated AttributeListener.
  • KitManagerImpl.logout() invokes logout() only on kits that implement LogoutListener.
  • All embedded kits that previously implemented AttributeListener now explicitly implement LogoutListener as well.
  • AttributeListenerTestKit implements both interfaces for instrumented tests.

Introduce KitIntegration.LogoutListener for logout handling; AttributeListener
no longer extends it. KitManagerImpl calls logout() on LogoutListener only.
Embedded kits that implement AttributeListener now explicitly implement
LogoutListener; AttributeListenerTestKit updated accordingly.
@denischilik denischilik requested a review from a team as a code owner March 27, 2026 18:21
@cursor
Copy link
Copy Markdown

cursor bot commented Mar 27, 2026

PR Summary

Medium Risk
Changes the kit API contract for logout handling and updates build/version resolution for kit modules, which could cause kits to miss logout callbacks or resolve the wrong android-kit-base artifact if not implemented/configured correctly.

Overview
Decouples logout handling from KitIntegration.AttributeListener. Introduces a new LogoutListener interface, removes logout() from the deprecated AttributeListener, and updates KitManagerImpl.logout() to call logout only on kits that implement LogoutListener.

Updates embedded kits/tests to match the new contract. Kits that previously relied on AttributeListener.logout() now explicitly implement LogoutListener (and the AttributeListenerTestKit does as well).

Stabilizes kit CI builds against local published artifacts. Workflows now publish/use a -ci version via -PVERSION=...-ci, and Gradle/KitPlugin are updated to resolve android-kit-base using the root VERSION property (with a root-level resolution strategy for kit subprojects) to avoid accidentally pulling an older Maven artifact.

Written by Cursor Bugbot for commit 48c71fe. This will update automatically on new commits. Configure here.

Kotlin CI failed resolving import com.mparticle.kits.KitIntegration.LogoutListener
for Java nested interfaces; use KitIntegration.LogoutListener in implements lists.

Made-with: Cursor
EventListener,
CommerceListener,
AttributeListener,
KitIntegration.LogoutListener,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would be nice to import the class and use just.

Suggested change
KitIntegration.LogoutListener,
LogoutListener,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Our Kotlin builds failed on CI with Unresolved reference 'LogoutListener' when we used import com.mparticle.kits.KitIntegration.LogoutListener

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Looks like kits during tests were using released version and it was original reason for failure

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, when the repos were separate, the core will be published first and the kits will consume it to get the updates in interfaces and contracts.
That need to be changed in new flow.

thomson-t
thomson-t previously approved these changes Mar 27, 2026
Ensures settings-kits.gradle resolves android-kit-base from the same
version published to mavenLocal, not the latest from Maven Central.

Made-with: Cursor
Use import com.mparticle.kits.KitIntegration.LogoutListener and LogoutListener
in kit implementations and KitManagerImpl instead of qualified KitIntegration.LogoutListener.

Made-with: Cursor
KitPlugin resolves android-kit-base via VERSION; isolated UA runs from
a subproject previously omitted -PVERSION and fell back to '+' (Central).
Run from repo root with -p and -PVERSION aligned with VERSION file.

Made-with: Cursor
Export VERSION from VERSION file to GITHUB_ENV so Gradle resolves the same
project property without repeating -PVERSION on every command.

Made-with: Cursor
- Append -ci to ORG_GRADLE_PROJECT_VERSION so kit resolution cannot match
  an already-published Central artifact for the same semver.
- Run publish + kit + urbanairship in one run block with export so every
  Gradle invocation shares the same VERSION property.

Made-with: Cursor
Revert merging multiple kit Gradle commands into a single run block.
Keep ORG_GRADLE_PROJECT_VERSION=$(head -n 1 VERSION)-ci so kits resolve
local maven artifacts that do not exist on Central.

Made-with: Cursor
GITHUB_ENV ORG_GRADLE_PROJECT_VERSION was not reliably applied when using
settings-kits.gradle; KitPlugin then fell back to '+' and resolved
android-kit-base from Maven Central. Pass -PVERSION=...-ci on each publish,
lint, ktlint, test, and urbanairship invocation.

Made-with: Cursor
@denischilik denischilik force-pushed the feat/remove-attribute-listener branch from 5d009a2 to 4848718 Compare March 27, 2026 20:52
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.

val dBlob = dBlob
val dcsRegion = dcsRegion
val userIdentities =
MParticle.getInstance()?.Identity()?.getCurrentUser()?.getUserIdentities() ?: emptyMap()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unfiltered user identities sent to Adobe kit

High Severity

The newly added userIdentities variable fetches identities via MParticle.getInstance()?.Identity()?.getCurrentUser()?.getUserIdentities(), which returns unfiltered identities from the raw MParticleUser. The KitIntegration base class provides getCurrentUser() which returns a FilteredMParticleUser — its getUserIdentities() applies both data plan filtering and kit configuration filtering (via shouldSetIdentity). Using the unfiltered path bypasses these controls and may send identity types to Adobe that the dashboard configuration has explicitly blocked.

Fix in Cursor Fix in Web

@denischilik denischilik force-pushed the feat/remove-attribute-listener branch from 48c71fe to 4848718 Compare March 27, 2026 21:23
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

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