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

React Native Android - Duplicated breadcrumbs since 7.11.0 ? #1493

Open
cristianoccazinsp opened this issue Aug 1, 2021 · 3 comments
Open
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug

Comments

@cristianoccazinsp
Copy link

Describe the bug

Since upgrading to 7.11.0, I'm observing duplicated breadcrumbs from custom-added log entries (with console.* statements replaced with bugsnag.notify, see below)

Steps to reproduce

Log various events in quick succession, the breadcrumbs prior to the reported log will end up duplicated.

Environment

  • Bugsnag version: 7.11.0
  • React-Native: 0.62.4
  • Device (e.g. iphonex): Android

Example code snippet

I'm intercepting console calls like this in prod/release modes:

console.warn = (arg1, ...rest) => {
  if (excludeMessage.test(arg1)) {
    return;
  }

  conf.bugsnag.notify(new Error(arg1), (event) => {
    event.severity = 'warning';
    event.groupingHash = 'handled.console.warn';

    if (event.errors && event.errors.length) {
      event.errors[0].errorClass = 'JSWarning';
    }

    event.addMetadata('args', {
      arg1: JSON.stringify(arg1),
      info: JSON.stringify(rest),
    });

    return true;
  });
};

Here's an example of a log entry showing the same log statement twice (one with the unhandled variable, which is odd?)

Screen Shot 2021-08-01 at 15 59 05

Did anything change internally and bugsnag is also intercepting console log calls? This does NOT happen on iOS by the way.

Error messages:

@mattdyoung
Copy link
Contributor

Hi @cristianoccazinsp

Thanks for reporting. It does look like a bug has been introduced in v7.11.0 resulting in the duplicated breadcrumbs. The bug doesn't look related to how you're intercepting console log calls, it seems to affect breadcrumbs logged for handled errors in general.

We're just investigating the cause and will aim to release a fix in due course.

@mattdyoung mattdyoung added backlog We hope to fix this feature/bug in the future bug Confirmed bug labels Aug 2, 2021
@cristianoccazinsp
Copy link
Author

If it helps, I managed to work around it by disabling the "console" logs on the android native side configuration with the following settings (also applied this to the iOS side just to be sure).

config.setEnabledBreadcrumbTypes(new HashSet<BreadcrumbType>() {{
  add(BreadcrumbType.NAVIGATION);
  add(BreadcrumbType.REQUEST);
  add(BreadcrumbType.ERROR);
  add(BreadcrumbType.STATE);
  add(BreadcrumbType.USER);
  add(BreadcrumbType.MANUAL);
  add(BreadcrumbType.PROCESS);
}});

Are there any drawbacks in using this configuration vs using the default one? I also noticed some flags like MANUAL and PROCESS are not documented in the docs (I had to find them in the actual source code / class info), which is a bit misleading.

@johnkiely1
Copy link
Member

Hi @cristianoccazinsp,

There should be no issues with using this approach. Thanks for highlighting the missing breadcrumb type options, we will look to get the docs updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants