Skip to content

refactor: centralize active kit filtering in KitManagerImpl#697

Merged
denischilik merged 6 commits intoworkstation/6.0-Releasefrom
feat/use-active-kits-helper
Apr 14, 2026
Merged

refactor: centralize active kit filtering in KitManagerImpl#697
denischilik merged 6 commits intoworkstation/6.0-Releasefrom
feat/use-active-kits-helper

Conversation

@denischilik
Copy link
Copy Markdown

@denischilik denischilik commented Apr 14, 2026

Background

This refactor centralizes active-kit filtering in KitManagerImpl to reduce repeated listener checks and keep forwarding behavior consistent.

What Has Changed

  • Replaced repeated providers.values() + disabled checks with activeKits() in push, lifecycle, identity, consent, and referrer callback paths.
  • Standardized forwarding loops to remove duplicated listener filtering logic and repeated casts.
  • Added a reusable typed helper (activeKitsOfType) and applied it to listener selection paths.

Screenshots/Video

N/A

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Use activeKits() in getRoktKitApi to centralize filtering of disabled kits and remove duplicated disabled checks.

Made-with: Cursor
Use activeKits() in setWrapperSdkVersion to centralize disabled-kit filtering and remove duplicate disabled checks.

Made-with: Cursor
Apply activeKits() in setLocation, logNetworkPerformance, and logCommerceEvent to centralize disabled-kit filtering and remove duplicated disabled checks.

Made-with: Cursor
Apply activeKits() in push callbacks, breadcrumb/error forwarding, and selected activity/session listeners to centralize disabled-kit filtering and remove repeated checks.

Made-with: Cursor
Apply activeKits() in installReferrerUpdated and identity/consent callback forwarding methods to centralize disabled-kit filtering and remove duplicated checks.

Made-with: Cursor
@denischilik denischilik requested a review from a team as a code owner April 14, 2026 14:29
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 14, 2026

PR Summary

Medium Risk
Refactors core kit-forwarding paths (push, commerce, lifecycle, identity/consent, referrer) to iterate only over active kits, which could subtly change which integrations receive callbacks if disabled-state handling differed previously.

Overview
Centralizes kit callback forwarding to only run against active (non-disabled) kits. Multiple forwarding loops in KitManagerImpl switch from iterating providers.values() with repeated isDisabled() checks to using activeKits().

This also standardizes listener casting using typed instanceof and introduces userAttributeListeners() to reuse active-kit + listener filtering, which is then used for consent/user-attribute related forwarding.

Reviewed by Cursor Bugbot for commit 99da62b. Bugbot is set up for automated code reviews on this repo. Configure here.

@sonarqubecloud
Copy link
Copy Markdown

@denischilik denischilik merged commit 1694682 into workstation/6.0-Release Apr 14, 2026
22 of 23 checks passed
@denischilik denischilik deleted the feat/use-active-kits-helper branch April 14, 2026 19:40
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