Skip to content

Conversation

gmsdelmundo
Copy link
Contributor

v4 UID generation

  • v4TokenUtils.java
  • v4TokenUtilsTest.java

v2/v3 vs v4 UID logic

  • TokenUtils.java
  • UIDOperatorService.java
  • UIDOperatorVerticleTest.java

Identity enum parity

  • IdentityEnvironment.java
  • IdentityScope.java
  • IdentityType.java
  • IdentityVersion.java
  • TokenUtils.java

Other formatting changes

  • Remaining files

@gmsdelmundo gmsdelmundo marked this pull request as draft September 4, 2025 05:52
@gmsdelmundo gmsdelmundo marked this pull request as ready for review September 9, 2025 06:48
@gmsdelmundo gmsdelmundo force-pushed the gdm-UID2-5837-v4-uid branch from 796e211 to baecb11 Compare October 3, 2025 10:20
advertisingId = TokenUtils.getAdvertisingIdV4(firstLevelHashIdentity.identityScope, firstLevelHashIdentity.identityType, env, firstLevelHashIdentity.id, key);
incrementAdvertisingIdVersionCounter("v4");
} catch (Exception e) {
LOGGER.error("Exception when generating V4 advertising ID", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should throw and result in a 500? Will something else up the stack throw if advertisingId is null?

Copy link
Contributor Author

@gmsdelmundo gmsdelmundo Oct 9, 2025

Choose a reason for hiding this comment

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

Updated it to throw a RuntimeException instead, similarly to v2/v3, which eventually results in a 500 HTTP error response


private byte[] getPreviousAdvertisingId(UserIdentity firstLevelHashIdentity, SaltEntry rotatingSalt, Instant asOf) {
private void incrementAdvertisingIdVersionCounter(String version) {
Counter.builder("uid2_raw_uid_version_total")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you prebuild the counters and map version ints to them? Registering has overhead and this builder causes unnecessary allocations

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