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

Stop using Advertising Id in track and match requests #39

Merged
merged 7 commits into from
Mar 11, 2021

Conversation

dimamo5
Copy link
Collaborator

@dimamo5 dimamo5 commented Mar 8, 2021

Depends on #38

Fetching and using the Advertising Id implicitly on track and match requests may lead the client app to break some privacy rules. It is also problematic on devices that don't use Google services or in devices with have stricter privacy settings. To avoid dealing with such issues we decided to shift the responsibility of using Google's Advertising Id to the client app.

So, this PR changes the track method to accept an UserId and stops fetching the Advertising Id on init and using it on track and match requests.

@dimamo5 dimamo5 requested a review from thyandrecardoso March 8, 2021 17:44
@dimamo5 dimamo5 self-assigned this Mar 8, 2021
@dimamo5 dimamo5 force-pushed the track-accepts-ids branch from daca4de to 9af97c8 Compare March 9, 2021 11:16
@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #39 (57eeb21) into master (d9531dc) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #39   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           8       6    -2     
  Lines         151     117   -34     
  Branches       21      19    -2     
======================================
+ Misses        151     117   -34     
Impacted Files Coverage Δ
...elocidi-sdk/src/main/kotlin/com/velocidi/UserId.kt 0.00% <0.00%> (ø)
...ocidi-sdk/src/main/kotlin/com/velocidi/Velocidi.kt 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d9531dc...57eeb21. Read the comment docs.

*/
data class UserId(val type: String, val id: String)
data class UserId(val id: String, val type: String = "gaid") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not related to this PR directly, but should we prevent empty ids?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in f19f929

Velocidi.getInstance().match("provider1", listOf(UserId("eml", "mail@example.com")))
Velocidi.getInstance().match(
"provider1",
listOf(UserId("123"), UserId("mail@example.com", "eml"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: can we remove literal email examples? This example in particular is not consistent with the id type and I think we should avoid exemplifying plain emails... Can we use a proper sha256 example here and in other examples?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I replace all the references of plain email in 57eeb21

*
* @param providerId Id of the match provider
* @param userIds List of user ids to be linked along with Advertising Id
* @param userIds List of user ids to be linked
*/
fun match(providerId: String, userIds: List<UserId>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not directly related to this PR, but can/should we force a non-empty list of ids?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in 87c2b67

@dimamo5 dimamo5 force-pushed the track-accepts-ids branch from 1317350 to 35314fd Compare March 10, 2021 14:19
@thyandrecardoso
Copy link
Contributor

Looks good. Waiting on the approval from @silva95gustavo.

@thyandrecardoso thyandrecardoso merged commit 70eb91f into master Mar 11, 2021
@thyandrecardoso thyandrecardoso deleted the track-accepts-ids branch March 11, 2021 10:38
@silva95gustavo
Copy link

Good job @dimamo5!

@dimamo5 dimamo5 mentioned this pull request Mar 23, 2021
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