Skip to content

Add first-open time to Remote Config fetch request. #3653

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

Merged
merged 4 commits into from
Apr 19, 2022

Conversation

richaurora
Copy link
Contributor

No description provided.

@@ -78,4 +78,6 @@ dependencies {
androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.25.0'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation "org.skyscreamer:jsonassert:1.5.0"

api 'joda-time:joda-time:2.10.14'
Copy link
Member

Choose a reason for hiding this comment

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

This is a pretty heavy dependency, especially given that you don't seem to do any arithmetic on it but just rely on its toString() method, I suggest to use the long directly and use SimpleDateFormat to convert it to an iso string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the dependency and replaced it with SimpleDataFormat. Thanks, I definitely struggled a bit with this and was looking for inputs!

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 14, 2022

Coverage Report 1

Affected Products

  • firebase-config

    Overall coverage changed from 88.82% (eb7bb1e) to 88.93% (8002ece) by +0.11%.

    FilenameBase (eb7bb1e)Merge (8002ece)Diff
    ConfigFetchHandler.java97.20%97.30%+0.09%
    ConfigFetchHttpClient.java85.82%86.33%+0.51%

Test Logs

Notes

  • Commit (8002ece) is created by Prow via merging PR base commit (eb7bb1e) and head commit (085c946).
  • Run gradle <product>:checkCoverage to produce HTML coverage reports locally. After gradle commands finished, report files can be found under <product-build-dir>/reports/jacoco/.

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/sKJLch4jxW.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 14, 2022

Size Report 1

Affected Products

  • firebase-config

    TypeBase (eb7bb1e)Merge (8002ece)Diff
    aar62.7 kB63.2 kB+549 B (+0.9%)
    apk (aggressive)93.3 kB93.5 kB+204 B (+0.2%)
    apk (release)731 kB732 kB+420 B (+0.1%)

Test Logs

Notes

  • Commit (8002ece) is created by Prow via merging PR base commit (eb7bb1e) and head commit (085c946).

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/hEgFX0GOUK.html

@richaurora richaurora requested a review from sknopf April 14, 2022 21:21
@@ -79,6 +80,9 @@ public class ConfigFetchHandler {
*/
@VisibleForTesting static final int HTTP_TOO_MANY_REQUESTS = 429;

/** First Open time key in GA user-properties. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Might add to the comment that this is a reserved property set by GA (I think that's the case?) per https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is an internal property. Updated the comment to say that it's collected by GA as part of of the predefined "user-dimensions". I called it "user-dimensions" following the recent GA documentation (https://support.google.com/firebase/answer/9268042?hl=en&ref_topic=6317484) but on second thought, maybe something simpler is better: "internal user-property automatically collected by GA" ?

@@ -174,6 +177,7 @@ FetchResponse fetch(
Map<String, String> analyticsUserProperties,
String lastFetchETag,
Map<String, String> customHeaders,
Instant firstOpenTime,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking aloud: it doesn't make sense to merge this in with the other analyticsUserProperties since we want to send it as its own request param.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, and the reason we want to send it in its own request param is because analyticsUserProperties in fetch traditionally contains custom user-defined properties only. And we want to keep, and highlight, that distinction. It also lets us explicitly call out the information that we are sending up to the server.

Copy link
Contributor

@danasilver danasilver left a comment

Choose a reason for hiding this comment

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

One small comment about a comment. Looks good to me!

@@ -79,6 +79,12 @@ public class ConfigFetchHandler {
*/
@VisibleForTesting static final int HTTP_TOO_MANY_REQUESTS = 429;

/**
* First-open-time key name in GA user-properties. First-open time is a predefined user-dimension
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nit, looks like you have "first-open time" for the most part in the comments so I'd make it consistent here, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. :)

Copy link

@sknopf sknopf left a comment

Choose a reason for hiding this comment

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

LGTM

@richaurora richaurora merged commit e6b01db into master Apr 19, 2022
@richaurora richaurora deleted the riora-new-user-targeting branch April 19, 2022 19:58
@firebase firebase locked and limited conversation to collaborators May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants