dd-sdk-reactnative icon indicating copy to clipboard operation
dd-sdk-reactnative copied to clipboard

Error Event Mapper is not being called

Open marcato15 opened this issue 11 months ago • 4 comments

Describe the bug

I am trying to filter out Memory Warnings on iOS from the error logs in our react native app. However, when I create a custom errorEventMapper it does not seem to run but memory warnings are still being created as errors in RUM. I've noticed that when I add console log statements to Resource and Action event mappers it does log it out but it does not for errors.

Note: Only reason I'm interested in logging out the event is so I can see the category used for Memory Warnings and conditionally return null. I've noticed that even when I return null for all events, it still is uploading the errors to data dog, so it doesn't appear the function is being called at all.

Reproduction steps

   config.errorEventMapper = event => {
      console.log(event);
    return event;
  };


SDK logs

No response

Expected behavior

The Error Event Mapper should be called and drop events that are returned null

Affected SDK versions

2.6.1

Latest working SDK version

N/A

Did you confirm if the latest SDK version fixes the bug?

Yes

Integration Methods

NPM

React Native Version

0.74.3

Package.json Contents

    "dependencies": {
      "@datadog/datadog-ci": "2.47.0",
      "@datadog/mobile-react-native": "2.6.1",
      "@datadog/mobile-react-navigation": "2.6.1",
      "@expo/config-plugins": "~8.0.0",
      "@expo/metro-config": "~0.18.1",
      "@expo/prebuild-config": "~7.0.0",
      "@react-native-async-storage/async-storage": "1.23.1",
      "@react-native-community/cli-platform-ios": "^11.3.8",
      "@react-native-community/netinfo": "11.3.1",
      "@react-navigation/elements": "^1.2.1",
      "@react-navigation/native": "^6.0.6",
      "@react-navigation/stack": "^6.0.11",
      "@reduxjs/toolkit": "^1.7.1",
      "expo": "^51.0.21",
      "expo-application": "~5.9.1",
      "expo-av": "~14.0.6",
      "expo-blur": "~13.0.2",
      "expo-build-properties": "~0.12.3",
      "expo-camera": "~15.0.14",
      "expo-checkbox": "~3.0.0",
      "expo-datadog": "^51.0.0",
      "expo-dev-client": "~4.0.18",
      "expo-file-system": "~17.0.1",
      "expo-font": "~12.0.9",
      "expo-image-manipulator": "~12.0.5",
      "expo-insights": "^0.7.0",
      "expo-keep-awake": "~13.0.2",
      "expo-notifications": "~0.28.10",
      "expo-screen-orientation": "~7.0.5",
      "expo-splash-screen": "~0.27.5",
      "expo-status-bar": "~1.12.1",
      "expo-updates": "~0.25.20",
      "metro-react-native-babel-transformer": "^0.77.0",
      "react": "18.2.0",
      "react-dom": "18.2.0",
      "react-native": "0.74.3",
      "react-native-device-info": "^8.4.8",
      "react-native-gesture-handler": "~2.16.1",
      "react-native-hyperlink": "^0.0.19",
      "react-native-incall-manager": "^4.2.0",
      "react-native-keychain": "^8.0.0",
      "react-native-localization": "^2.1.7",
      "react-native-localize": "^2.1.7",
      "react-native-modal-selector": "^2.1.2",
      "react-native-reanimated": "~3.10.1",
      "react-native-safe-area-context": "4.10.5",
      "react-native-screens": "3.31.1",
      "react-native-svg": "15.8.0",
      "react-native-uuid": "^2.0.1",
      "react-native-webview": "^13.10.3",
      "react-redux": "^7.2.6",
      "styled-components": "^5.3.3"
    },

### iOS Setup

_No response_

### Android Setup

_No response_

### Device Information

All iOS devices

### Other relevant information

_No response_

marcato15 avatar Jan 14 '25 17:01 marcato15

@marcato15 have you always had these memory errors and are just trying to ignore them? or have you spotted a new trend for them growing?

reason I ask, is we're noticing an up-tick in memory errors, it was part of a bunch of dep updates - dd -> 2.6.1 being one of them

export-mike avatar Jan 15 '25 02:01 export-mike

It’s the memory pressure warnings from iOS. I don’t believe they were classified as errors before. I don’t think they are increasing.

marcato15 avatar Jan 15 '25 03:01 marcato15

ah nice @marcato15 thanks! I think this is what we're seeing too

export-mike avatar Jan 15 '25 03:01 export-mike

Seeing the same on 2.6.3. Mapper does not intercept memory warnings. In testing, I trigger them with [[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)]; and I do see them in the corresponding session. Mapper sees errors I'm adding manually with .addError just fine.

mlisikbf avatar Apr 07 '25 17:04 mlisikbf