Skip to content

Reverts native display.#1010

Merged
CTLalit merged 2 commits into
developfrom
revert/native-display-public-method
May 19, 2026
Merged

Reverts native display.#1010
CTLalit merged 2 commits into
developfrom
revert/native-display-public-method

Conversation

@CTLalit
Copy link
Copy Markdown
Collaborator

@CTLalit CTLalit commented May 19, 2026

Summary by CodeRabbit

  • Breaking Changes

    • Removed pushDisplayUnitElementClickedEventForID() API for display unit element interactions.
    • Removed setDisplayUnitCache() API for custom display unit management.
  • Chores

    • Updated release date to May 20, 2026.

Review Change Stack

@CTLalit CTLalit requested a review from piyush-kukadiya May 19, 2026 20:18
@francispereira
Copy link
Copy Markdown

francispereira commented May 19, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6c9e1716-7ca8-4b39-b516-db7e2f17cd35

📥 Commits

Reviewing files that changed from the base of the PR and between e3090b2 and 4bdb06e.

📒 Files selected for processing (14)
  • CHANGELOG.md
  • clevertap-core/src/main/java/com/clevertap/android/sdk/AnalyticsManager.java
  • clevertap-core/src/main/java/com/clevertap/android/sdk/BaseAnalyticsManager.java
  • clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java
  • clevertap-core/src/main/java/com/clevertap/android/sdk/ControllerManager.java
  • clevertap-core/src/main/java/com/clevertap/android/sdk/displayunits/CTDisplayUnitController.java
  • clevertap-core/src/main/java/com/clevertap/android/sdk/displayunits/DisplayUnitCache.java
  • clevertap-core/src/main/java/com/clevertap/android/sdk/login/LoginController.java
  • clevertap-core/src/main/java/com/clevertap/android/sdk/response/DisplayUnitResponse.java
  • clevertap-core/src/test/java/com/clevertap/android/sdk/AnalyticsManagerTest.kt
  • clevertap-core/src/test/java/com/clevertap/android/sdk/MockAnalyticsManager.kt
  • clevertap-core/src/test/java/com/clevertap/android/sdk/displayunits/CTDisplayUnitControllerTest.kt
  • docs/CTCORECHANGELOG.md
  • templates/CTCORECHANGELOG.md

Walkthrough

This PR migrates display unit management from the DisplayUnitCache interface to direct CTDisplayUnitController usage. The controller now parses JSON arrays instead of list-based updates, public element-clicked event APIs are removed, and all event attribution and display unit lookups route through the consolidated controller instance.

Changes

Display Unit Cache Consolidation

Layer / File(s) Summary
Display Unit Controller Contract
clevertap-core/src/main/java/com/clevertap/android/sdk/displayunits/CTDisplayUnitController.java
CTDisplayUnitController ceases to implement DisplayUnitCache, changes updateDisplayUnits from list-based to JSON-array-based with inline parsing and error logging, removes @Override annotations, and narrows getDisplayUnitForID parameter from @Nullable String to String.
ControllerManager Refactor
clevertap-core/src/main/java/com/clevertap/android/sdk/ControllerManager.java
Replaces internal DisplayUnitCache storage with direct ctDisplayUnitController field, removes deprecated cache accessors, removes @Deprecated annotations from controller getter/setter, and updates imports.
Public API Cleanup
clevertap-core/src/main/java/com/clevertap/android/sdk/AnalyticsManager.java, BaseAnalyticsManager.java, CleverTapAPI.java, MockAnalyticsManager.kt
Removes pushDisplayUnitElementClickedEventForID method from implementation and abstract base; removes setDisplayUnitCache from CleverTapAPI and ControllerManager.
Event Attribution Routing
clevertap-core/src/main/java/com/clevertap/android/sdk/AnalyticsManager.java, CleverTapAPI.java
Display unit click and viewed events source attribution from getCTDisplayUnitController().getDisplayUnitForID() instead of cache; public getAllDisplayUnits() and getDisplayUnitForId() delegate to controller with null-check logging.
Response and State Management
clevertap-core/src/main/java/com/clevertap/android/sdk/response/DisplayUnitResponse.java, login/LoginController.java
DisplayUnitResponse directly invokes controller's JSON-based updateDisplayUnits and passes results to callback; LoginController.resetDisplayUnits() calls controller reset instead of cache reset.
Test Migration
clevertap-core/src/test/java/com/clevertap/android/sdk/AnalyticsManagerTest.kt, CTDisplayUnitControllerTest.kt
Display unit event tests mock ctDisplayUnitController instead of displayUnitCache; CTDisplayUnitControllerTest rewrites update/reset/error-handling assertions for JSON-array input; geofence assertions tightened to exact value matching.
Metadata
CHANGELOG.md, docs/CTCORECHANGELOG.md, templates/CTCORECHANGELOG.md
Release date for Version 8.2.0 updated from May 19 to May 20, 2026.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • CleverTap/clevertap-android-sdk#999: Both PRs modify display-unit plumbing in CleverTapAPI, ControllerManager, and AnalyticsManager; #999 introduces DisplayUnitCache-based routing while this PR removes it in favor of CTDisplayUnitController.
  • CleverTap/clevertap-android-sdk#1009: Both PRs touch the same display-unit event APIs in AnalyticsManager/BaseAnalyticsManager/CleverTapAPI; #1009 introduces element-clicked event support which this PR removes and replaces with controller-based attribution.

Suggested labels

7.7.0

Suggested reviewers

  • piyush-kukadiya
  • deeksha-rgb
  • darshanclevertap
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert/native-display-public-method

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CTLalit CTLalit merged commit 989f636 into develop May 19, 2026
8 of 9 checks passed
@CTLalit CTLalit deleted the revert/native-display-public-method branch May 19, 2026 20:19
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.

3 participants