-
Notifications
You must be signed in to change notification settings - Fork 992
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
[wip] backend funnel fix #235
Conversation
…nstance().getId()`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some small changes, ty
|
||
private void setVisitorCookie() { | ||
final String deviceId = InstanceID.getInstance(this).getId(); | ||
final String uuid = TextUtils.isEmpty(deviceId) ? UUID.randomUUID().toString() : deviceId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to uniqueIdentifier
} | ||
|
||
private Optional<HttpCookie> getOptionalVisitorCookieForURI(final @NonNull CookieStore cookieStore, final @NonNull URI webUri) { | ||
// it's problematic, i know |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine
final HttpCookie webCookie = webVisCookie.get(); | ||
final HttpCookie apiCookie = apiVisCookie.get(); | ||
|
||
Assert.assertNotNull(webCookie); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of asserting they aren't null, assert that cookie.isPresent()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM!
* attempting to have unique tracking ids, switching to `InstanceId.getInstance().getId()` and our first instrumentation test
what
We should be setting the visitor cookie on web and api. The value is
InstanceId.getInstance().getId()
. Read more about it here -> https://developer.android.com/training/articles/user-data-ids.html.I also added our first instrumentation test ✨ but I'm doing some gross stuff with optionals so I'm open to feedback. (Cookies are returned as a list and not a map because 2 cookies can have the same name, party time.)
Shout out to @ryanpeterson for pairing on this with me for many moons.