Comments (7)
Hi @parrotbait - thanks for raising this. Please could you share the code you're using to set the userID
? Feel free to write into [email protected] with links to events in your dashboard where this isn't working as expected and we'd be happy to investigate further 👍
from bugsnag-cocoa.
I've updated the issue above further with the service calls captured via proxy, it's an on-premise hosted Bugsnag instance so you won't be able to access them.
I can share only pseudo code of what I've tried but it won't be especially useful I feel.
let userID: String? = AuthenticationService.shared.user.id // this can be `nil` if the user isn't logged in.
Bugsnag.setUser(userID, withEmail: email, andName: name)
I've also tried something like:
Bugsnag.addOnSession { session in
let userID: String? = AuthenticationService.shared.user.id
session.setUser(userID, withEmail: nil, andName: nil)
}
Using both of these approaches Bugsnag on iOS still sends along the device and app hash instead of nil
for display on the console.
from bugsnag-cocoa.
Hi @parrotbait - calling session.setUser
inside the addOnSession
callback will only update the metadata that is sent with the session payload to Bugsnag (i.e. it won't impact event payloads, which are ultimately what are shown in your Bugsnag dashboard). In your session payload above you can see that this is working as expected according to the "user": {}
element.
To set the current user globally, you're best to either do this via the setUser
config method, or using the setUser
method on the Bugsnag client. In my own testing the following code correctly clears the current user, overriding the default setting which is to set the userId
to the deviceId
:
Bugsnag.setUser(nil, withEmail: nil, andName: nil)
Where in your app are you calling Bugsnag.setUser
?
from bugsnag-cocoa.
Ah ok - that makes sense.
I've called setUser
on the config before the starts(with:)
call, and also directly on the Bugsnag client after start(with:)
so we clear down the Bugsnag fallback hash should the user be nil
on the config.
I'm also calling setUser
on the Bugsnag client when users authenticate, which can happen at somewhat arbitrary times during the app lifecycle.
from bugsnag-cocoa.
Hi @parrotbait - I've managed to reproduce what you're seeing here now. As documented here, if no userID
is set we fall back on the Bugsnag generated deviceID
. To prevent collection of this, you should instead set the value to an empty string, i.e.
Bugsnag.setUser("", withEmail: nil, andName: nil)
The current behaviour on bugsnag-cocoa
actually differs between handled and unhandled events, and in fact your approach above does work for handled events (which is what I initially tested). This discrepancy is unintentional and we're just completing some internal discussions to decide the best way forward. I'll make sure we keep this thread updated with any changes in the future.
from bugsnag-cocoa.
Ah, that's good to know. Thanks for looking into it.
from bugsnag-cocoa.
Hey @parrotbait, just to let you know we have updated the behaviour in v6.22.0 to be consistent.
We will now use device.id
in place of user.id
for all events and sessions if BugsnagClient.user.id
is set to nil
.
To prevent collection completely, set it to an empty string or update it in OnSendError
/ OnSession
from bugsnag-cocoa.
Related Issues (20)
- `Bugsnag.featureFlags()` returning `nil` HOT 1
- Calling NSProcessInfo.thermalState from an app with bugsnag installed crashes with _os_unfair_lock_recursive_abort HOT 3
- Bugsnag build phase script to auto upload dsym with Xcode 14 failed to upload HOT 12
- Will this pop up infinitely? HOT 1
- Swift Command-Line Failure to Upload HOT 3
- App builds in Xcode 14.3 beta fail with Use of undeclared identifier '_PTHREAD_MUTEX_SIG_init' HOT 3
- Loadconfig memory leak HOT 3
- Uploading dSYM seems to not working using Build phase script manually HOT 3
- [BSGAppHangDetector startWithDelegate:] crash HOT 6
- Bugsnag does not compile for visionOS with Xcode 15 Beta 2 HOT 2
- Duplicate library warning in Xcode 15 Beta HOT 7
- Support unhandled Kotlin Native Exceptions HOT 1
- App crashes when trying to start Bugsnag on Watch app HOT 1
- Bugsnag keep user data after logout in crash reports HOT 2
- Apple's update to their API policy about Privacy Manifest HOT 6
- OWASP: Buffer Overflow Vulnerabilities HOT 1
- Privacy manifest causing collisions through CocoaPods HOT 2
- Apple Report Missing API declaration HOT 2
- StartWithConfig memory leak HOT 5
- NSPrivacyAccessedAPICategoryDiskSpace : Missing API declaration HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bugsnag-cocoa.