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

ID missing after setting username field #4036

Open
trst74 opened this issue Jun 4, 2024 · 2 comments
Open

ID missing after setting username field #4036

trst74 opened this issue Jun 4, 2024 · 2 comments
Labels
Breaking-change should go in a major release (breaks apps, changes default configs in a major way) Platform: Cocoa Type: Bug
Milestone

Comments

@trst74
Copy link

trst74 commented Jun 4, 2024

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

@philipphofmann
Copy link
Member

philipphofmann commented Jun 5, 2024

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.

- (void)setUserIdIfNoUserSet:(SentryEvent *)event
{
// We only want to set the id if the customer didn't set a user so we at least set something to
// identify the user.
if (event.user == nil) {
SentryUser *user = [[SentryUser alloc] init];
user.userId = [SentryInstallation idWithCacheDirectoryPath:self.options.cacheDirectoryPath];
event.user = user;
}
}

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 philipphofmann modified the milestone: 9.0.0 Jun 5, 2024
@philipphofmann philipphofmann added Breaking-change should go in a major release (breaks apps, changes default configs in a major way) labels Jun 5, 2024
@trst74
Copy link
Author

trst74 commented Jun 5, 2024

Thanks a lot ! We'll be waiting :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking-change should go in a major release (breaks apps, changes default configs in a major way) Platform: Cocoa Type: Bug
Projects
Status: No status
Status: Backlog
Development

No branches or pull requests

3 participants