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

iOS Native breadcrumbs not being added to javascript events #780

Closed
3 of 7 tasks
brainbicycle opened this issue Feb 24, 2020 · 7 comments
Closed
3 of 7 tasks

iOS Native breadcrumbs not being added to javascript events #780

brainbicycle opened this issue Feb 24, 2020 · 7 comments

Comments

@brainbicycle
Copy link

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native
  • react-native-sentry

SDK version: 1.3.1
react-native version: 0.61.4

Init Code:

Sentry.init({
  debug: true,
  dsn: 'https://[email protected]/...'
});

I have the following issue:
Our application has a combination of native Objective-C code and react native code. Because of this we track and add breadcrumbs to sentry from both react native and objective-C. With react-native-sentry these breadcrumbs were showing up alongside each other in sentry issues. We recently tried upgrading from react-native-sentry to the new @sentry/react-native and noticed native breadcrumbs are no longer being sent along from javascript events and only react-native breadcrumbs are showing up in issues. It seems like this code https://github.com/getsentry/sentry-cocoa/blob/52f057f31cceb326cb68ca1212ea96c2f0ad53db/Sources/Sentry/SentryNSURLRequest.m#L47 explicitly ignores other event data when json is present. So my question is is there a way to get the old behavior or is this not supported?

Steps to reproduce:

  • Initialize sentry in javascript
  • add a breadcrumb in javascript
  • add a breadcrumb in objective-C [[SentryClient.sharedClient.breadcrumbs] addBreadcrumb: breadcrumb];
  • fire an event from javascript

Actual result:

  • event shows up in dashboard with only javascript breadcrumbs

Expected result:

  • event shows up in dashboard with both javascript and objective-C breadcrumb

Thanks for any help you can give and apologies if I am missing something obvious.

@HazAT
Copy link
Member

HazAT commented Feb 26, 2020

Yep, we are aware of that.
Thanks for reporting we will try to add support for it.

@mefjuu
Copy link

mefjuu commented Mar 5, 2020

@HazAT Great! We are looking forward to seeing JS context in native crashes. It also relates to Android #694

@tr3v3r
Copy link

tr3v3r commented Jun 11, 2020

@HazAT Any updates here?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2021

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@marandaneto
Copy link
Contributor

This is already working for a long time, are you using the latest version @brainbicycle ? please let us know if that still does not work

@marandaneto
Copy link
Contributor

Closing the issue as a part of large repository cleanup, due to it being inactive and/or outdated. There's a large chance that this issue has been solved since.
Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it.
Cheers!

Repository owner moved this from In Progress to Done in Mobile & Cross Platform SDK Dec 20, 2021
@collinprice
Copy link

@marandaneto I upgraded to @sentry/react-native 3.2.8 and iOS native breadcrumbs are still not appearing when the exception occurs in javascript.

In my objective-c code I am generating breadcrumbs using the follow:

SentryBreadcrumb *crumb = [[SentryBreadcrumb alloc] init];
crumb.level = kSentryLevelError;
crumb.category = @"storage";
crumb.message = [NSString stringWithFormat:@"%@ - %@", method, message];

[SentrySDK addBreadcrumb:crumb];

In my javascript I am just using throw new Error("test") after calling my native function.

In xcode I can see the Sentry debug messages but these breadcrumbs are not included with the issue.

2021-12-20 11:38:42.267863-0500 BioTest2[355:12997] Sentry - debug:: Add breadcrumb: <SentryBreadcrumb: 0x283841ac0>
2021-12-20 11:38:42.268140-0500 BioTest2[355:12997] [DEBUG] readItem:withStatus: - start
2021-12-20 11:38:42.268265-0500 BioTest2[355:12997] Sentry - debug:: Add breadcrumb: <SentryBreadcrumb: 0x283842540>
2021-12-20 11:38:42.268446-0500 BioTest2[355:12997] [DEBUG] baseQuery - start
2021-12-20 11:38:42.268562-0500 BioTest2[355:12997] Sentry - debug:: Add breadcrumb: <SentryBreadcrumb: 0x283841c80>
2021-12-20 11:38:42.268728-0500 BioTest2[355:12997] [DEBUG] getService - start
2021-12-20 11:38:42.269525-0500 BioTest2[355:12997] Sentry - debug:: Add breadcrumb: <SentryBreadcrumb: 0x283842400>
2021-12-20 11:38:42.275452-0500 BioTest2[355:12997] [DEBUG] copy done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

6 participants