Skip to content

Add support for enqueueing daily and unique pixels#7639

Merged
lmac012 merged 3 commits intodevelopfrom
feature/lukasz/enqueue-daily-and-unique-pixels
Feb 3, 2026
Merged

Add support for enqueueing daily and unique pixels#7639
lmac012 merged 3 commits intodevelopfrom
feature/lukasz/enqueue-daily-and-unique-pixels

Conversation

@lmac012
Copy link
Contributor

@lmac012 lmac012 commented Feb 2, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1213068706396582?focus=true

Description

This PR adds PixelType param to enqueueFire() method in the Pixel interface, aligning functionality between fire() and enqueueFire() methods.

Steps to test this PR

The new API is not in use yet, so this PR is QA-optional.

No UI changes


Note

Medium Risk
Medium risk because it changes the core analytics enqueueing contract and adds new suppression logic for daily/unique pixels, which could alter what gets persisted and sent if misapplied.

Overview
Aligns Pixel.enqueueFire with fire by adding a PixelType parameter (defaulting to Count) so enqueued pixels can be treated as count, daily, or unique events.

Updates PixelSender.enqueuePixel to accept PixelType and return Single<EnqueuePixelResult> (PIXEL_ENQUEUED/PIXEL_IGNORED), and changes RxPixelSender to apply the same daily/unique suppression + fired-state tracking when enqueueing (not just when sending).

Adjusts RxBasedPixel logging to reflect enqueue outcomes, and updates stubs/fakes and unit tests across modules to pass the new type argument and assert the new behavior.

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

Copy link
Contributor Author

lmac012 commented Feb 2, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lmac012 lmac012 force-pushed the feature/lukasz/enqueue-daily-and-unique-pixels branch from da5c874 to 9985b3a Compare February 2, 2026 10:29
@lmac012 lmac012 marked this pull request as ready for review February 2, 2026 14:11
Copy link

@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.

pixel: PixelName,
parameters: Map<String, String>,
encodedParameters: Map<String, String>,
type: PixelType,
Copy link

Choose a reason for hiding this comment

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

Type parameter not passed in enqueueFire fake implementation

Low Severity

The FakePixel test implementation adds the new type parameter to both enqueueFire method signatures but doesn't actually use it. At line 62, the call to the overloaded enqueueFire doesn't pass the type parameter. At line 76, PixelType.Count is hardcoded instead of using the type parameter. This differs from how the fire() methods in the same file correctly pass through the type parameter and is inconsistent with the production RxBasedPixel implementation.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor

@landomen landomen left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for aligning the APIs 🏅

encodedQueryParams = encodedParameters,
)
pendingPixelDao.insert(pixelEntity)
storePixelFired(pixelName, type)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is my thinking here correct: calling this ensures only one Daily/Unique pixel is fired even if another part of the app calls pixel.fire() on the same pixel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. fire() and enqueueFire() share the same underlying storage to keep track of which unique or daily pixels have already been fired. So, for example, if the code previously used fire() to send a unique pixel and is later updated to use enqueueFire(), that pixel won’t be fired a second time.

@lmac012 lmac012 merged commit 3868d25 into develop Feb 3, 2026
24 checks passed
@lmac012 lmac012 deleted the feature/lukasz/enqueue-daily-and-unique-pixels branch February 3, 2026 09:14
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