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

Is there a reason why hashedDefaultUser doesn't hash the "default" user that TelemetryDeck uses #190

Closed
bvirlet opened this issue Oct 4, 2024 · 1 comment · Fixed by #214

Comments

@bvirlet
Copy link

bvirlet commented Oct 4, 2024

TelemetryDeck uses the identifierForVendor internally unless a default user is specified. However, the hashedDefaultUser method provided below only returns a non-nil value if a default user is provided.

I'd like to just be able to get the hashed default user of the internal value, even without setting a default user with updateDefaultUser.

Currently, I set the default user to identifierForVendor as specified in the documentation here but it seems an unnecessary step to "make hashedDefaultUser work".

Unless I'm missing something.

Thanks!

@Jeehut
Copy link
Contributor

Jeehut commented Dec 2, 2024

@bvirlet Thank you for asking this question!

The hashedDefaultUser was introduced in #180 with the following reasoning:

This allows customers to access the hashed version of the user string they’ve set, in order to hand it over to other SDKs or webhooks.

While the main goal clearly was to give a convenient way to users to access the hashed default user when a custom one was set, I don't really see any reason why this should only work then a custom value was set. I think you're right that the default identifierForVendor-based value should be returned here if the user has not provided a custom user.

I just implemented a fix for this in #214. But please note that the fix requires that we mark the hashedDefaultUser with the @MainActor attribute, which technically is a breaking change. So I leave it to @winsmith to decide if the tradeoff is worth the change (at least for users who migrated to the Swift 6 world).

I personally think you're right, but we've been shipping other changes recently in our SDK in other places, too. So we have to be cautious about our users' reaction to these kinds of things.

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 a pull request may close this issue.

2 participants