Skip to content

Unknown user despite userId, userName set. #70196

@lhunath

Description

@lhunath

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

Unclear.
Event which exhibits the problem: us.sentry.io.json
Event which shows the user correctly: us.sentry.io.json
You will notice, both events contain an e-mail address and user name in the user key.
We do notice that the problem exhibits on iOS whereas the working issue was reported under Linux.
Both events are for the same project.

open func startCrashLogger() {
    SentrySDK.start(configureOptions: self.sentry(options:))
}

open func sentry(options: Sentry.Options) {
    // TODO: https://github.com/getsentry/team-mobile/issues/24
    // options.enabled = false
    options.sendDefaultPii = true
    options.environment = AppInfo.shared.configuration.lowercased()
    options.enablePreWarmedAppStartTracing = true
    options.enableMetricKit = true
    options.swiftAsyncStacktraces = true
    options.initialScope = self.sentry(scope:)
    options.beforeSend = self.sentry(event:)
    options.attachScreenshot = true
    options.attachViewHierarchy = true
    options.dsn = "https://[email protected]/5225762"
    options.tracesSampleRate = 0.1
    options.profilesSampleRate = 0.1
}

open func sentry(scope: Sentry.Scope) -> Sentry.Scope {
    scope.setTag(value: AppInfo.shared.build, key: "app.build")
    scope.setTag(value: AppInfo.shared.version, key: "app.version")
    scope.setTag(value: AppInfo.shared.configuration, key: "app.configuration")
    scope.setTag(value: AppInfo.shared.reference, key: "app.reference")
    scope.setTag(value: AppInfo.shared.revision, key: "app.revision")
    return scope
}

open func sentry(event: Sentry.Event) -> Sentry.Event? {
    event
}

Expected Result

I expect both events to show the user described under the Tags header in the Sentry report.

Actual Result

(Note however that both events correctly report the user in the details area)

Event which exhibits the problem:
image
image

Event which shows the user correctly:
image
image

Product Area

Issues

Link

https://hubstaff.sentry.io/issues/5278254369/events/863b8b8487bb46e08927cb2dfbc97d5b/

DSN

https://[email protected]/5225762

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions