Skip to content

feature/cp-11715-add-exist-and-does-not-exist-logic-to-attributes-android#354

Merged
snuricp merged 5 commits into
masterfrom
feature/cp-11715-add-exist-and-does-not-exist-logic-to-attributes-android
Jun 8, 2026
Merged

feature/cp-11715-add-exist-and-does-not-exist-logic-to-attributes-android#354
snuricp merged 5 commits into
masterfrom
feature/cp-11715-add-exist-and-does-not-exist-logic-to-attributes-android

Conversation

@unnaticleverpush

@unnaticleverpush unnaticleverpush commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Added a new Attribute condition type in Targeting for AppBanner: Exists/NotExists


Note

Low Risk
Small, localized change to banner attribute filter evaluation with no auth or network impact; wrong key presence logic could only mis-target banners.

Overview
App banner attribute targeting can now use Exists and NotExists relations (exists / notExists on CheckFilterRelation), so campaigns can target subscribers by whether a given attribute key is present, not only by value comparisons.

In isBannerAttributeTargetingAllowed, those relations read SUBSCRIPTION_ATTRIBUTES from shared preferences and set a match from JSONObject.has(attributeId); NotExists inverts that. Parse failures leave currentMatch false (same as other relations on error). Existing value-based relations are unchanged.

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


Summary by cubic

Adds Exists/NotExists attribute targeting for AppBanner on Android so campaigns can match when a subscription attribute key is present or absent. Satisfies Linear CP-11715.

  • New Features
    • Added Exists and NotExists to CheckFilterRelation with string keys exists and notExists.
    • In isBannerAttributeTargetingAllowed, read SUBSCRIPTION_ATTRIBUTES and check JSONObject.has(attributeId); on JSON parse error neither relation matches.

Written for commit 73eaaa7. Summary will update on new commits.

Review in cubic

…roid

Added a new Attribute condition type in Targeting for `AppBanner`: Exists/NotExists
@unnaticleverpush unnaticleverpush self-assigned this Jun 8, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java Outdated
Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e7de6d4. Configure here.

Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java Outdated
Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java">

<violation number="1" location="cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java:757">
P1: NotExists parse-error handling contradicts documented asymmetric error handling. The PR description specifies that on corrupted JSON: Exists fails (false) and NotExists passes (true). But this change flips NotExists to also fail (currentMatch = false), making the error handling symmetric instead of asymmetric. This means users with corrupted subscription attributes data will never match NotExists targeting rules, which directly contradicts the stated test spec 'Corrupted SUBSCRIPTION_ATTRIBUTES JSON: Exists fails; NotExists passes.' Additionally, the rationale is sound: if attributes can't be parsed, we can't confirm the key exists, so NotExists should treat the attribute as absent and match.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread cleverpush/src/main/java/com/cleverpush/banner/AppBannerModule.java
@snuricp snuricp merged commit ba7e4dc into master Jun 8, 2026
4 of 6 checks passed
@snuricp snuricp deleted the feature/cp-11715-add-exist-and-does-not-exist-logic-to-attributes-android branch June 8, 2026 08:10
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