You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having a similar issue as this issue except it occurs when making a Sentry.setExtraContext call. This error only occurs on iOS.
I was able to workaround the issue to an extent using the following code to change what certain properties (listed in the steps to reproduce below) were set to on the object passed to Sentry.setExtraContext:
function getSentrySetExtraContextObjectForIOS(setExtraContextObject: any): any {
const setExtraContextObjectClone = {...setExtraContextObject};
for (const setExtraContextObjectPropertyName in setExtraContextObject) {
setExtraContextObjectClone[setExtraContextObjectPropertyName] = getSentrySetExtraContextObjectPropertyValueForIOS(setExtraContextObject[setExtraContextObjectPropertyName]);
}
return setExtraContextObjectClone;
}
function getSentrySetExtraContextObjectPropertyValueForIOS(setExtraContextObjectPropertyValue: any): any {
if (setExtraContextObjectPropertyValue === null) {
return "sentrySetExtraContextNullValueIOSWorkaround";
}
else if (_.isPlainObject(setExtraContextObjectPropertyValue)) {
return getSentrySetExtraContextObjectForIOS(setExtraContextObjectPropertyValue);
}
else if (Array.isArray(setExtraContextObjectPropertyValue)) {
return setExtraContextObjectPropertyValue.map((value, index, array) => {
return getSentrySetExtraContextObjectPropertyValueForIOS(value);
});
}
else {
return setExtraContextObjectPropertyValue;
}
}
This code doesn't cover arrays that only have certain indexes set on them so I just deleted those properties from the cloned object.
After all that, we decided that we would rather be sure we will get an error in Sentry so we are not using this workaround and omitting the object causing the error from the object passed to Sentry.setExtraContext with the hope that this GitHub issue will be resolved.
Steps to reproduce:
Pass Sentry.setExtraContext an object with at least one property (it can be a nested object property) that has one of the following values:
null
An array with null values in it.
An array of objects with at least one property with a null value.
An array with only some indexes set.
Run on iOS
Execute code that makes the Sentry.setExtraContext call get hit.
Actual result:
The following error occurs on line 292 of SentryClient.m:
I am closing all old issues, please if this is still a problem feel free to revive it.
Also, consider moving to our new SDK @sentry/react-native if it still happens there please open a new issue.
OS:
Platform:
Config:
I have the following issue:
I am having a similar issue as this issue except it occurs when making a
Sentry.setExtraContext
call. This error only occurs on iOS.I was able to workaround the issue to an extent using the following code to change what certain properties (listed in the steps to reproduce below) were set to on the object passed to
Sentry.setExtraContext
:This code doesn't cover arrays that only have certain indexes set on them so I just deleted those properties from the cloned object.
After all that, we decided that we would rather be sure we will get an error in Sentry so we are not using this workaround and omitting the object causing the error from the object passed to
Sentry.setExtraContext
with the hope that this GitHub issue will be resolved.Steps to reproduce:
Pass
Sentry.setExtraContext
an object with at least one property (it can be a nested object property) that has one of the following values:Run on iOS
Execute code that makes the
Sentry.setExtraContext
call get hit.Actual result:
Expected result:
The text was updated successfully, but these errors were encountered: