Skip to content

feature/cp-10979-removing-a-subscription-attribute#334

Merged
gbhrdt-cp merged 2 commits intomasterfrom
feature/cp-10979-removing-a-subscription-attribute
Mar 11, 2026
Merged

feature/cp-10979-removing-a-subscription-attribute#334
gbhrdt-cp merged 2 commits intomasterfrom
feature/cp-10979-removing-a-subscription-attribute

Conversation

@unnaticleverpush
Copy link
Contributor

@unnaticleverpush unnaticleverpush commented Mar 3, 2026

Created removeSubscriptionAttribute(attributeId), removeSubscriptionAttribute(attributeId, CompletionFailureListener) and removeSubscriptionAttributes(attributeIds)


Summary by cubic

Adds public APIs and a helper to remove subscription attributes with sequential queues, tracking consent, and SharedPreferences sync. Aligns with Linear CP-10979 to clear single or multiple attributes.

  • New Features

    • Added removeSubscriptionAttribute(..) and removeSubscriptionAttributes(..), incl. a CompletionFailureListener overload.
    • Processes removals via a dedicated queue and RemoveSubscriptionAttributes helper; can append IDs while in flight.
    • Updates SharedPreferences after each success via RemoveSubscriptionAttributeResponseHandler.
    • Safely no-ops on null or empty inputs.
  • Refactors

    • Split attribute queues into add and remove flows for clearer processing.
    • Added factory methods in SubscriptionAttributeTagRequest and updated tag/attribute paths to use them.

Written for commit 3dfb1e3. Summary will update on new commits.

Created removeSubscriptionAttribute(attributeId), removeSubscriptionAttribute(attributeId, CompletionFailureListener) and removeSubscriptionAttributes(attributeIds)
@unnaticleverpush unnaticleverpush self-assigned this Mar 3, 2026
Copy link

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

Choose a reason for hiding this comment

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

2 issues found across 5 files

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/RemoveSubscriptionAttributes.java">

<violation number="1" location="cleverpush/src/main/java/com/cleverpush/RemoveSubscriptionAttributes.java:75">
P2: `removeSubscriptionAttribute` uses `currentPositionOfAttributeToRemove` without validating it against `attributeIds`, so a caller can trigger an ArrayIndexOutOfBoundsException/NullPointerException. Add a bounds/null guard before using the index.</violation>
</file>

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

<violation number="1" location="cleverpush/src/main/java/com/cleverpush/CleverPush.java:2659">
P2: Guard against null/empty `attributeId` before enqueueing; otherwise a null input leaves the remove-attribute queue stuck in a processing state and prevents later removals from executing.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@gbhrdt-cp gbhrdt-cp merged commit 217ee64 into master Mar 11, 2026
3 of 5 checks passed
@gbhrdt-cp gbhrdt-cp deleted the feature/cp-10979-removing-a-subscription-attribute branch March 11, 2026 08:42
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