Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Bugsnag: The metadata recorded for key 'app' is not formatted as key/value pairs. Discarding. #133

Closed
SudoPlz opened this issue Aug 17, 2017 · 3 comments

Comments

@SudoPlz
Copy link

SudoPlz commented Aug 17, 2017

For some reason the metadata stopped getting attached.

if (![metadata[sectionKey] isKindOfClass:[NSDictionary class]]) {

I've tried this way:

bugsnagConfig.registerBeforeSendCallback((report) => {
        const metadata = report.metadata || {};
        metadata.clients = {
             clientName: 'foo'
        };
        report.metadata = metadata;
      });

and that way:

bugsnagConfig.registerBeforeSendCallback((report) => {
        report.addMetadata('state', 'device', 'test')
      });

I get both:
Bugsnag: The metadata recorded for key 'app' is not formatted as key/value pairs. Discarding.
and
Bugsnag: The metadata recorded for key 'clients' is not formatted as key/value pairs. Discarding.

in both cases.

What's going on? That same code used to work a while ago.

@kattrali
Copy link
Contributor

Thanks for the report, @SudoPlz. Which versions of react native and bugsnag-react-native are you using? I'll reproduce.

@SudoPlz
Copy link
Author

SudoPlz commented Aug 17, 2017

Follow up: I tried changing that NSLog to:

NSLog(@"Bugsnag: The metadata recorded for key '%@' is not formatted as key/value pairs for data %@ which is of type %@. Discarding.", sectionKey, metadata[sectionKey],NSStringFromClass( [metadata[sectionKey] class]));

and I now receive:
Bugsnag: The metadata recorded for key 'app' is not formatted as key/value pairs for data [object Object] which is of type __NSCFString. Discarding.

@kattrali I'm using:
react-native: 0.46.3
bugsnag-react-native: 2.3.1

Thanks!

@kattrali
Copy link
Contributor

Merging this into #132

Jekiwijaya pushed a commit to Jekiwijaya/bugsnag-react-native that referenced this issue Mar 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants