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

[NT-814] Partition key value precedence #1044

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

justinswart
Copy link
Contributor

@justinswart justinswart commented Jan 23, 2020

πŸ“² What

Updates the value of partition-key in the record dictionary for our DataLake tracking client.

πŸ€” Why

Instead of just using a random UUID for this value we would like to use the user's ID (when available), the device identifier if the user's ID is not available, and a random UUID as a fail-safe value.

Note: As per the Apple docs, the identifierForVendor can only sometimes be nil if the device has not yet been unlocked. This probably only affects apps that access this value in the background but seeing as this can potentially be nil we coalesce using a non-nil UUID string.

πŸ›  How

Updated the partition key value to coalesce from user ID through to identifierForVendor and lastly UUID().uuidString.

βœ… Acceptance criteria

  • If logged in the partition-key value should be that of the User's ID.
  • If logged out the value should be that of the device identifier identifierForVendor value.
  • If neither of these are available the value should be a random UUID. This is only proven by the unit tests.

Copy link

@amyfain amyfain left a comment

Choose a reason for hiding this comment

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

Looks good to me πŸŽ‰

@justinswart justinswart merged commit 74bedb7 into master Jan 23, 2020
@justinswart justinswart deleted the NT-814-partition-key-user-id branch January 23, 2020 21:08
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.

None yet

3 participants