^ title
Yes, it is always set to ["{{ default }}"] event when it is passing into Sentry.captureException().
@HazAT I am stuck when tried group messages using fingerprint. Could you tell me which is event of react-native-sentry that I can modify log data to add fingerprint attribute ?
Can we set the fingerprint in react-native-sentry only with Sentry.configureScope? This does not feel right for only one time changes. Because we only want the modified the fingerprint for one call. This cause to Code like this:
let fingerprint = null;
Sentry.configureScope((scope) => {
scope.setFingerprint(fingerprint || ['{{default}}']);
});
function specialException(error, tags) {
fingerprint = tags;
Sentry.captureException(error);
fingerprint = null;
}
@JBenda D you can use like this example for custom sentry catch (crash, exception ... )
export const captureMessage = (message, extra = {}, level = 'warning') => {
Sentry.captureMessage(message, {
level,
extra,
fingerprint: ['Type: Crash', 'Message: null is not object']
})
}
It seems to be a problem with the native integration (on iOS at least). Disabling it worked for me:
Sentry.config("***", {
disableNativeIntegration: true
}).install();
function captureException(error, name) {
Sentry.captureException(error, {
fingerprint: ["{{ default }}", name]
});
}
captureException(new Error("404 Not found"), "getUser");
captureException(new Error("404 Not found"), "getSettings");
To get to this conclusion, I followed the instructions here. I was able to verify that even if I manually set the fingerprint via the dataCallback, it never reaches Sentry. You can check if that's the case for you too by looking into the JSON representation of your exception on the Sentry console. In my case, the fingerprint was always set to {{ default }}.
I haven't investigated why this happens though.
According to release notes this should be fixed in 0.40.2 however upon upgrading, the fingerprint seems to be sent on Android, but not on iOS. Does anything extra needs to be configured for it to work on iOS? We've updated the library, unlinked and linked react-native-sentry again, and re-added the framework/library in XCode, it hasn't changed anything :(
FYI @llostris @maximeaubaret et al., I think I've got a fix for this over at https://github.com/getsentry/sentry-cocoa/pull/279. Certainly explains why disabling the native integration did the trick for you!
For anyone else scratching their head over this before it makes it into a release, it's easy to make the one line change directly in your Pods directory (for @CocoaPods users), or using e.g., [patch-package(https://github.com/ds300/patch-package)] if not.
@HazAT Any chance of getting that fix released?
@llostris It's been merged into master in sentry-cocoa — I've submitted another PR with a version bump to trigger a release: https://github.com/getsentry/sentry-cocoa/pull/281
The last step will be to simply update this repo's podspec to point to the patched version of sentry-cocoa. (cc @HazAT)
Release 0.40.3 going out now, closing this for now.
Thanks again for the quick turnaround @HazAT! 👍
Most helpful comment
Release
0.40.3going out now, closing this for now.