Skip to content

Conversation

@aitorvs
Copy link
Collaborator

@aitorvs aitorvs commented Mar 11, 2021

Task/Issue URL: https://app.asana.com/0/0/1200049149472987/f
Tech Design URL: https://app.asana.com/0/715106103902962/1200043236683507/f
CC:

Description:
This PR

  • abstracts the PixelName as an interface so that it can be extended
  • pixel definitions can thus be kept private to the gradle module that uses them

Steps to test this PR:

  1. App should comile

(it is not extrictly necessary to perform any test as all issues should be detected at compile time)


Internal references:

Software Engineering Expectations
Technical Design Template

@aitorvs aitorvs force-pushed the feature/aitor/pixels branch from ca42480 to 4d34aa7 Compare March 12, 2021 09:35
@aitorvs aitorvs force-pushed the feature/aitor/pixels branch from 4d34aa7 to f913790 Compare March 12, 2021 09:51
Comment on lines +32 to +39
WEB_RENDERER_GONE_CRASH("m_d_wrg_c"),
WEB_RENDERER_GONE_KILLED("m_d_wrg_k"),

APP_LAUNCH("ml"),

FORGET_ALL_PRESSED_BROWSING("mf_bp"),
FORGET_ALL_PRESSED_TABSWITCHING("mf_tp"),
FORGET_ALL_EXECUTED("mf"),
FORGET_ALL_AUTO_RESTART("m_f_r"),
FORGET_ALL_AUTO_RESTART_WITH_INTENT("m_f_ri"),
COOKIE_DATABASE_NOT_FOUND("m_cdb_nf"),
COOKIE_DATABASE_OPEN_ERROR("m_cdb_oe"),
COOKIE_DATABASE_DELETE_ERROR("m_cdb_de"),
COOKIE_DATABASE_CORRUPTED_ERROR("m_cdb_ce"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These pixels are use in the OfflinePixelSender that lives in the statistics gradle module.
I think at some point we should also look into not having these pixels in the statistics gradle module. Ideally it should only contain the public API for the pixels, but none of the pixel names to be sent.
for now I just left these here

@aitorvs aitorvs marked this pull request as ready for review March 12, 2021 10:25
@aitorvs aitorvs requested a review from malmstein March 12, 2021 10:25
Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

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

small comment on the test logging, otherwise great work @aitorvs

fun verifyNoDuplicatePixelNames() {
val existingNames = mutableSetOf<String>()
Pixel.PixelName.values().forEach {
AppPixelName.values().forEach {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Pixel.PixelName.values().forEach {
AppPixelName.values().forEach {
if (!existingNames.add(it.pixelName)) {
fail("Duplicate pixel name found: ${it.pixelName}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe be more specific towards what type of pixel is missing? Something like "Duplicate app / statistics pixel name found"

@aitorvs aitorvs merged commit 4ac0c4d into develop Mar 16, 2021
@aitorvs aitorvs deleted the feature/aitor/pixels branch March 16, 2021 09:33
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