Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AppTP WAU pixel #5292

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Add AppTP WAU pixel #5292

merged 2 commits into from
Nov 22, 2024

Conversation

aitorvs
Copy link
Collaborator

@aitorvs aitorvs commented Nov 20, 2024

Task/Issue URL: https://app.asana.com/0/69071770703008/1208808769852413/f

Description

Add a pixel for AppTP MAU.

The pixel fires at most once every 28 days

Steps to test this PR

You may want to change the polici to REPLACE in scheduleDeviceShieldStatusReporting() to trigger the pixel on every app onCreate

Test

  • clean install from this branch and launch the app
  • enable AppTP
  • force close the app and re-open
  • verify the m_atp_ev_enabled_monthly is sent
  • force close the app and re-open
  • verify the m_atp_ev_enabled_monthly is NOT sent
  • move the device date no more that 28d from now
  • force close the app and re-open
  • verify the m_atp_ev_enabled_monthly is NOT sent
  • move the device date no more that 29d from now
  • force close the app and re-open
  • verify the m_atp_ev_enabled_monthly is sent

Copy link
Collaborator Author

aitorvs commented Nov 20, 2024

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

@aitorvs aitorvs force-pushed the feature/aitor/apptp/wau branch from 815f236 to 8d59648 Compare November 20, 2024 17:00
val daysBetween = ChronoUnit.DAYS.between(firstDate, secondDate).absoluteValue

// Check if the difference is more than 28 days
return daysBetween > 28
Copy link

Choose a reason for hiding this comment

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

The condition daysBetween > 28 will fire pixels every 29 days, while the test expects firing at 28 days. Changing to daysBetween >= 28 would align the implementation with the test and maintain the intended monthly cadence.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

verifyNoMoreInteractions(pixel)
}

@Test
fun whenReportEnable28DaysApartReportMonthlyPixel() {
Copy link

Choose a reason for hiding this comment

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

The test name appears to be incorrect. This test verifies that a pixel is fired when exactly 28 days apart, but the name suggests the opposite. Consider renaming to whenReportExactly28DaysApartThenFireMonthlyPixel to match the test's actual behavior.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@aitorvs aitorvs force-pushed the feature/aitor/apptp/wau branch from 8d59648 to 221b4a5 Compare November 21, 2024 08:13
@aitorvs aitorvs marked this pull request as ready for review November 21, 2024 13:27
@chrisbolin
Copy link

The PR title implies weekly, not monthly. Maybe just change WAU to MAU.

Copy link
Contributor

@karlenDimla karlenDimla left a comment

Choose a reason for hiding this comment

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

Just rename tests for clarity and everything looks good and works as expected.

@aitorvs aitorvs merged commit 5e3063d into develop Nov 22, 2024
6 checks passed
@aitorvs aitorvs deleted the feature/aitor/apptp/wau branch November 22, 2024 15:38
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