I'm adding extra info to the metadata object (with addMetadata), but for some reason json keys are being nested and added twice. This didn't happen before the migration to @bugsnag/react-native: 7.3.3
The following code is used in the onError callback to add extra data:

However, when the log is received, some keys are nested and duplicated into other keys, like this:

This gets even worse the more objects are added to the log, ending up with massive payloads.
Library versions:
@bugsnag/react-native: 7.3.3
react-native: 0.62.2
debug mode or production?: Prod
[X] (iOS only) [BugsnagReactNative start] is present in the
application:didFinishLaunchingWithOptions: method in your AppDelegate
class?
BugsnagReactNative.start(this) is present in theonCreate method of your MainApplication class?yarn install and react-native run-ios/react-native run-androidbugsnagConf.onError = function(event) {
if (conf.env === 'dev'){
console.warn("Bugsnag error not sent: ", event, event.errors);
return false;
}
else{
if (global.store){
let state = global.store.getState();
if(!state.settings.autoSendErrorLogs){
return false;
}
let queueInfo = {
queue: {
total: String(state.queue.total),
error: String(state.queue.errors)
},
sync: {
status: state.sync.status,
statusInfo: state.sync.statusInfo,
lastSync: state.sync.lastSync ? (new Date(state.sync.lastSync).toISOString()) : state.sync.lastSync,
lastUpdate: String(state.sync.lastUpdate),
currentTime: new Date().toISOString()
},
network: JSON.stringify(state.network)
};
event.addMetadata('queueInfo', queueInfo);
return true;
}
}
};
I would love to know if this is an usage issue or an actual bug. Either way, it is increasing data usage significantly.
Update: While debugging, there doesn't really seem like there are duplicate keys. Any chance bugsnag on the server side is causing this?
Update 2: Looks like this doesn't happen all the time, but only for android devices.
@cristianoccazinsp
Are you able to readily reproduce this when testing?
If so, would you be able to log out the queueInfo object in full when this happens so we can see exactly what gets sent in the payload?
Could you contact [email protected] referencing this issue and provide both the logged metadata and a link to the exact occurrence which that relates to in your Bugsnag dashboard using the Copy event link option shown:

Hello,
I have done what was requested. Here's the capture showing a breakpoint with the metadata object that's set to the bugsnag's event. Not sure if this is what you were looking for:

Note: the app may be different, but the code and bug is exactly the same.
We have been able to replicate this issue. We are going to take a look.
Hello guys,
Any estimate about when this may get resolved? We are looking into pushing a new release shortly and are wondering if we should wait or not for this to be addressed.
Thanks.
@cristianoccazinsp Sorry, I do not have an estimate for the resolution as yet, but we will keep this thread posted with any updates.
This has been transferred to the bugsnag-js repo as the Bugsnag react native library is now part of this repository (as of v7.3).
Hi @cristianoccazinsp,
This has now been fixed and is released in v7.4.0.