sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

ID missing after setting username field

Open trst74 opened this issue 1 year ago • 2 comments

Platform

iOS

Environment

Production, Develop

Installed

Swift Package Manager

Version

8.10.0

Xcode Version

15.1

Did it work on previous versions?

No response

Steps to Reproduce

iOS SDK and android SDK have difference in terms of setting username. ID dissapears from webinterface after setting username on iOS, but staying on android. Example:

Android: Снимок экрана 2024-06-04 в 23 40 40

iOS: Снимок экрана 2024-06-04 в 23 41 12

There is ID field missing on iOS, and naming of fields is different after setting username. As i suppose if ID not set, we have fallback to installationID (which not work for some reason on iOS?..)

Expected Result

ID field still present, after setting username or other User fields.

Actual Result

ID field missing.

Are you willing to submit a PR?

No response

trst74 avatar Jun 04 '24 18:06 trst74

That's a good catch, @trst74 💯 . Thanks, for pointing this out.

I think it would make sense to change the logic to set a userID if no userID is set here to align with Android.

https://github.com/getsentry/sentry-cocoa/blob/5e579afa2abba914448ad2b79995cbfbb142f5f3/Sources/Sentry/SentryClient.m#L799-L808

Strictly speaking, this is a breaking change, as some people could rely on the current behavior. The next major will happen soon, so we can include it there.

philipphofmann avatar Jun 05 '24 13:06 philipphofmann

Thanks a lot ! We'll be waiting :)

trst74 avatar Jun 05 '24 20:06 trst74