@sentry/react-native 5.14.0 → 5.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/RNSentry.podspec +15 -2
  3. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +3 -5
  4. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +1 -1
  5. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +1 -1
  6. package/dist/js/NativeRNSentry.d.ts +1 -1
  7. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  8. package/dist/js/NativeRNSentry.js.map +1 -1
  9. package/dist/js/index.d.ts +4 -3
  10. package/dist/js/index.d.ts.map +1 -1
  11. package/dist/js/index.js.map +1 -1
  12. package/dist/js/integrations/debugsymbolicator.d.ts +25 -3
  13. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  14. package/dist/js/integrations/debugsymbolicator.js +109 -70
  15. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  16. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +4 -0
  17. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  18. package/dist/js/integrations/reactnativeerrorhandlers.js +10 -1
  19. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  20. package/dist/js/tracing/index.d.ts +3 -2
  21. package/dist/js/tracing/index.d.ts.map +1 -1
  22. package/dist/js/tracing/index.js.map +1 -1
  23. package/dist/js/utils/error.d.ts +19 -0
  24. package/dist/js/utils/error.d.ts.map +1 -0
  25. package/dist/js/utils/error.js +30 -0
  26. package/dist/js/utils/error.js.map +1 -0
  27. package/dist/js/vendor/base64-js/fromByteArray.d.ts +5 -0
  28. package/dist/js/vendor/base64-js/fromByteArray.d.ts.map +1 -0
  29. package/dist/js/vendor/base64-js/fromByteArray.js +61 -0
  30. package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -0
  31. package/dist/js/vendor/base64-js/index.d.ts +2 -0
  32. package/dist/js/vendor/base64-js/index.d.ts.map +1 -0
  33. package/dist/js/vendor/base64-js/index.js +2 -0
  34. package/dist/js/vendor/base64-js/index.js.map +1 -0
  35. package/dist/js/vendor/index.d.ts +2 -0
  36. package/dist/js/vendor/index.d.ts.map +1 -1
  37. package/dist/js/vendor/index.js +2 -0
  38. package/dist/js/vendor/index.js.map +1 -1
  39. package/dist/js/vendor/react-native/index.d.ts +27 -0
  40. package/dist/js/vendor/react-native/index.d.ts.map +1 -0
  41. package/dist/js/vendor/react-native/index.js +3 -0
  42. package/dist/js/vendor/react-native/index.js.map +1 -0
  43. package/dist/js/version.d.ts +1 -1
  44. package/dist/js/version.js +1 -1
  45. package/dist/js/version.js.map +1 -1
  46. package/dist/js/wrapper.d.ts.map +1 -1
  47. package/dist/js/wrapper.js +18 -12
  48. package/dist/js/wrapper.js.map +1 -1
  49. package/ios/RNSentry.h +12 -0
  50. package/ios/RNSentry.mm +4 -8
  51. package/metro.d.ts +1 -0
  52. package/metro.js +1 -0
  53. package/package.json +4 -4
  54. package/{sample-new-architecture → samples/react-native}/react-native.config.js +1 -1
  55. package/scripts/sentry-xcode.sh +1 -1
  56. package/scripts/sentry_utils.rb +33 -0
  57. package/src/js/NativeRNSentry.ts +1 -1
  58. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
  59. package/ts3.8/dist/js/index.d.ts +4 -3
  60. package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +25 -3
  61. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +4 -0
  62. package/ts3.8/dist/js/tracing/index.d.ts +3 -2
  63. package/ts3.8/dist/js/utils/error.d.ts +19 -0
  64. package/ts3.8/dist/js/vendor/base64-js/fromByteArray.d.ts +5 -0
  65. package/ts3.8/dist/js/vendor/base64-js/index.d.ts +2 -0
  66. package/ts3.8/dist/js/vendor/index.d.ts +2 -0
  67. package/ts3.8/dist/js/vendor/react-native/index.d.ts +27 -0
  68. package/ts3.8/dist/js/version.d.ts +1 -1
@@ -1,6 +1,7 @@
1
1
  import { __awaiter } from "tslib";
2
2
  import { getCurrentHub } from '@sentry/core';
3
3
  import { addExceptionMechanism, logger } from '@sentry/utils';
4
+ import { createSyntheticError, isErrorLike } from '../utils/error';
4
5
  import { RN_GLOBAL_OBJ } from '../utils/worldwide';
5
6
  /** ReactNativeErrorHandlers Integration */
6
7
  export class ReactNativeErrorHandlers {
@@ -63,7 +64,7 @@ export class ReactNativeErrorHandlers {
63
64
  * Attach the unhandled rejection handler
64
65
  */
65
66
  _attachUnhandledRejectionHandler() {
66
- const tracking = require('promise/setimmediate/rejection-tracking');
67
+ const tracking = this._loadRejectionTracking();
67
68
  const promiseRejectionTrackingOptions = {
68
69
  onUnhandled: (id, rejection = {}) => {
69
70
  // eslint-disable-next-line no-console
@@ -85,6 +86,7 @@ export class ReactNativeErrorHandlers {
85
86
  getCurrentHub().captureException(error, {
86
87
  data: { id },
87
88
  originalException: error,
89
+ syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),
88
90
  });
89
91
  },
90
92
  onHandled: (id) => {
@@ -187,6 +189,13 @@ export class ReactNativeErrorHandlers {
187
189
  }));
188
190
  }
189
191
  }
192
+ /**
193
+ * Loads and returns rejection tracking module
194
+ */
195
+ _loadRejectionTracking() {
196
+ // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies
197
+ return require('promise/setimmediate/rejection-tracking');
198
+ }
190
199
  }
191
200
  /**
192
201
  * @inheritDoc
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcnD,2CAA2C;AAC3C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ACX,MAAM,CAAC,KAAK,CAAC,0DAA0D,EAAE,KAAK,CAAC,CAAC;oBAEhF,+EAA+E;oBAC/E,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBAE/B,OAAO;iBACR;gBAED,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;gBAEpC,MAAM,IAAI,GAAc;oBACtB,iBAAiB,EAAE,KAAK;oBACxB,WAAW,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc,EAAE;iBACrC,CAAC;gBACF,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAE3D,IAAI,OAAO,EAAE;oBACX,KAAK,CAAC,KAAK,GAAG,OAAwB,CAAC;oBAEvC,qBAAqB,CAAC,KAAK,EAAE;wBAC3B,OAAO,EAAE,KAAK;wBACd,IAAI,EAAE,SAAS;qBAChB,CAAC,CAAC;iBACJ;gBAED,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAErC,IAAI,CAAC,OAAO,EAAE;oBACZ,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wBAC3D,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBACjC,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,gFAAgF;oBAChF,mCAAmC;oBACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;iBAChC;YACH,CAAC,CAAA,CAAC,CAAC;SACJ;IACH,CAAC;;AAvOD;;GAEG;AACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { EventHint, Integration, SeverityLevel } from '@sentry/types';\nimport { addExceptionMechanism, logger } from '@sentry/utils';\n\nimport type { ReactNativeClient } from '../client';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport class ReactNativeErrorHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeErrorHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeErrorHandlers.id;\n\n /** ReactNativeOptions */\n private readonly _options: ReactNativeErrorHandlersOptions;\n\n /** Constructor */\n public constructor(options?: Partial<ReactNativeErrorHandlersOptions>) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n this._handleUnhandledRejections();\n this._handleOnError();\n }\n\n /**\n * Handle Promises\n */\n private _handleUnhandledRejections(): void {\n if (this._options.onunhandledrejection) {\n if (this._options.patchGlobalPromise) {\n this._polyfillPromise();\n }\n\n this._attachUnhandledRejectionHandler();\n this._checkPromiseAndWarn();\n }\n }\n /**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\n private _polyfillPromise(): void {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n\n const Promise = this._getPromisePolyfill();\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n polyfillGlobal('Promise', () => Promise);\n /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n }\n\n /**\n * Single source of truth for the Promise implementation we want to use.\n * This is important for verifying that the rejected promise tracing will work as expected.\n */\n private _getPromisePolyfill(): unknown {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n return require('promise/setimmediate/es6-extensions');\n }\n\n /**\n * Attach the unhandled rejection handler\n */\n private _attachUnhandledRejectionHandler(): void {\n const tracking: {\n disable: () => void;\n enable: (arg: unknown) => void;\n // eslint-disable-next-line import/no-extraneous-dependencies,@typescript-eslint/no-var-requires\n } = require('promise/setimmediate/rejection-tracking');\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n },\n onHandled: id => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`,\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: Error) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n getCurrentHub().captureException(error, {\n data: { id },\n originalException: error,\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n }\n /**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\n private _checkPromiseAndWarn(): void {\n try {\n // `promise` package is a dependency of react-native, therefore it is always available.\n // but it is possible that the user has installed a different version of promise\n // or dependency that uses a different version.\n // We have to check if the React Native Promise and the `promise` package Promise are using the same reference.\n // If they are not, likely there are multiple versions of the `promise` package installed.\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const ReactNativePromise = require('react-native/Libraries/Promise');\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const PromisePackagePromise = require('promise/setimmediate/es6-extensions');\n const UsedPromisePolyfill = this._getPromisePolyfill();\n\n if (ReactNativePromise !== PromisePackagePromise) {\n logger.warn(\n 'You appear to have multiple versions of the \"promise\" package installed. ' +\n 'This may cause unexpected behavior like undefined `Promise.allSettled`. ' +\n 'Please install the `promise` package manually using the exact version as the React Native package. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n\n // This only make sense if the user disabled the integration Polyfill\n if (UsedPromisePolyfill !== RN_GLOBAL_OBJ.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n }\n /**\n * Handle errors\n */\n private _handleOnError(): void {\n if (this._options.onerror) {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = errorUtils.getGlobalHandler && errorUtils.getGlobalHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log('Encountered multiple fatals in a row. The latest:', error);\n return;\n }\n handlingFatal = true;\n }\n\n const currentHub = getCurrentHub();\n const client = currentHub.getClient<ReactNativeClient>();\n const scope = currentHub.getScope();\n\n if (!client) {\n logger.error('Sentry client is missing, the error event might be lost.', error);\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const options = client.getOptions();\n\n const hint: EventHint = {\n originalException: error,\n attachments: scope?.getAttachments(),\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event, hint);\n\n if (!__DEV__) {\n void client.flush(options.shutdownTimeout || 2000).then(() => {\n defaultHandler(error, isFatal);\n });\n } else {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n }\n });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcnD,2CAA2C;AAC3C,MAAM,OAAO,wBAAwB;IAcnC,kBAAkB;IAClB,YAAmB,OAAkD;QATrE;;WAEG;QACI,SAAI,GAAW,wBAAwB,CAAC,EAAE,CAAC;QAOhD,IAAI,CAAC,QAAQ,mBACX,OAAO,EAAE,IAAI,EACb,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,IAAI,IACrB,OAAO,CACX,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,SAAS;QACd,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACK,0BAA0B;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE;YACtC,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;gBACpC,IAAI,CAAC,gBAAgB,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CAAC,CAAC;gBAE3D,IAAI,OAAO,EAAE;oBACX,KAAK,CAAC,KAAK,GAAG,OAAwB,CAAC;oBAEvC,qBAAqB,CAAC,KAAK,EAAE;wBAC3B,OAAO,EAAE,KAAK;wBACd,IAAI,EAAE,SAAS;qBAChB,CAAC,CAAC;iBACJ;gBAED,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAErC,IAAI,CAAC,OAAO,EAAE;oBACZ,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wBAC3D,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBACjC,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,gFAAgF;oBAChF,mCAAmC;oBACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;iBAChC;YACH,CAAC,CAAA,CAAC,CAAC;SACJ;IACH,CAAC;IAED;;OAEG;IACK,sBAAsB;QAI5B,gGAAgG;QAChG,OAAO,OAAO,CAAC,yCAAyC,CAAC,CAAC;IAC5D,CAAC;;AA/OD;;GAEG;AACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { EventHint, Integration, SeverityLevel } from '@sentry/types';\nimport { addExceptionMechanism, logger } from '@sentry/utils';\n\nimport type { ReactNativeClient } from '../client';\nimport { createSyntheticError, isErrorLike } from '../utils/error';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport class ReactNativeErrorHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeErrorHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeErrorHandlers.id;\n\n /** ReactNativeOptions */\n private readonly _options: ReactNativeErrorHandlersOptions;\n\n /** Constructor */\n public constructor(options?: Partial<ReactNativeErrorHandlersOptions>) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n this._handleUnhandledRejections();\n this._handleOnError();\n }\n\n /**\n * Handle Promises\n */\n private _handleUnhandledRejections(): void {\n if (this._options.onunhandledrejection) {\n if (this._options.patchGlobalPromise) {\n this._polyfillPromise();\n }\n\n this._attachUnhandledRejectionHandler();\n this._checkPromiseAndWarn();\n }\n }\n /**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\n private _polyfillPromise(): void {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n\n const Promise = this._getPromisePolyfill();\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n polyfillGlobal('Promise', () => Promise);\n /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n }\n\n /**\n * Single source of truth for the Promise implementation we want to use.\n * This is important for verifying that the rejected promise tracing will work as expected.\n */\n private _getPromisePolyfill(): unknown {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n return require('promise/setimmediate/es6-extensions');\n }\n\n /**\n * Attach the unhandled rejection handler\n */\n private _attachUnhandledRejectionHandler(): void {\n const tracking = this._loadRejectionTracking();\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n },\n onHandled: id => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`,\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: unknown) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n getCurrentHub().captureException(error, {\n data: { id },\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n }\n /**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\n private _checkPromiseAndWarn(): void {\n try {\n // `promise` package is a dependency of react-native, therefore it is always available.\n // but it is possible that the user has installed a different version of promise\n // or dependency that uses a different version.\n // We have to check if the React Native Promise and the `promise` package Promise are using the same reference.\n // If they are not, likely there are multiple versions of the `promise` package installed.\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const ReactNativePromise = require('react-native/Libraries/Promise');\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const PromisePackagePromise = require('promise/setimmediate/es6-extensions');\n const UsedPromisePolyfill = this._getPromisePolyfill();\n\n if (ReactNativePromise !== PromisePackagePromise) {\n logger.warn(\n 'You appear to have multiple versions of the \"promise\" package installed. ' +\n 'This may cause unexpected behavior like undefined `Promise.allSettled`. ' +\n 'Please install the `promise` package manually using the exact version as the React Native package. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n\n // This only make sense if the user disabled the integration Polyfill\n if (UsedPromisePolyfill !== RN_GLOBAL_OBJ.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n }\n /**\n * Handle errors\n */\n private _handleOnError(): void {\n if (this._options.onerror) {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = errorUtils.getGlobalHandler && errorUtils.getGlobalHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log('Encountered multiple fatals in a row. The latest:', error);\n return;\n }\n handlingFatal = true;\n }\n\n const currentHub = getCurrentHub();\n const client = currentHub.getClient<ReactNativeClient>();\n const scope = currentHub.getScope();\n\n if (!client) {\n logger.error('Sentry client is missing, the error event might be lost.', error);\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const options = client.getOptions();\n\n const hint: EventHint = {\n originalException: error,\n attachments: scope?.getAttachments(),\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event, hint);\n\n if (!__DEV__) {\n void client.flush(options.shutdownTimeout || 2000).then(() => {\n defaultHandler(error, isFatal);\n });\n } else {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n }\n });\n }\n }\n\n /**\n * Loads and returns rejection tracking module\n */\n private _loadRejectionTracking(): {\n disable: () => void;\n enable: (arg: unknown) => void;\n } {\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n return require('promise/setimmediate/rejection-tracking');\n }\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  export { ReactNativeTracing } from './reactnativetracing';
2
- export { RoutingInstrumentation, RoutingInstrumentationInstance } from './routingInstrumentation';
2
+ export type { RoutingInstrumentationInstance } from './routingInstrumentation';
3
+ export { RoutingInstrumentation } from './routingInstrumentation';
3
4
  export { ReactNavigationInstrumentation, ReactNavigationV5Instrumentation, } from './reactnavigation';
4
5
  export { ReactNavigationV4Instrumentation } from './reactnavigationv4';
5
6
  export { ReactNativeNavigationInstrumentation } from './reactnativenavigation';
6
- export { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';
7
+ export type { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';
7
8
  export { ReactNativeProfiler } from './reactnativeprofiler';
8
9
  export { sentryTraceGesture } from './gesturetracing';
9
10
  export * from './ops';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAElG,OAAO,EACL,8BAA8B,EAE9B,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAE/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,YAAY,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACL,8BAA8B,EAE9B,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEpH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,cAAc,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAkC,MAAM,0BAA0B,CAAC;AAElG,OAAO,EACL,8BAA8B;AAC9B,mDAAmD;AACnD,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAI/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,cAAc,OAAO,CAAC","sourcesContent":["export { ReactNativeTracing } from './reactnativetracing';\n\nexport { RoutingInstrumentation, RoutingInstrumentationInstance } from './routingInstrumentation';\n\nexport {\n ReactNavigationInstrumentation,\n // eslint-disable-next-line deprecation/deprecation\n ReactNavigationV5Instrumentation,\n} from './reactnavigation';\nexport { ReactNavigationV4Instrumentation } from './reactnavigationv4';\nexport { ReactNativeNavigationInstrumentation } from './reactnativenavigation';\n\nexport { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';\n\nexport { ReactNativeProfiler } from './reactnativeprofiler';\n\nexport { sentryTraceGesture } from './gesturetracing';\n\nexport * from './ops';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACL,8BAA8B;AAC9B,mDAAmD;AACnD,gCAAgC,GACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAI/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,cAAc,OAAO,CAAC","sourcesContent":["export { ReactNativeTracing } from './reactnativetracing';\n\nexport type { RoutingInstrumentationInstance } from './routingInstrumentation';\nexport { RoutingInstrumentation } from './routingInstrumentation';\n\nexport {\n ReactNavigationInstrumentation,\n // eslint-disable-next-line deprecation/deprecation\n ReactNavigationV5Instrumentation,\n} from './reactnavigation';\nexport { ReactNavigationV4Instrumentation } from './reactnavigationv4';\nexport { ReactNativeNavigationInstrumentation } from './reactnativenavigation';\n\nexport type { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';\n\nexport { ReactNativeProfiler } from './reactnativeprofiler';\n\nexport { sentryTraceGesture } from './gesturetracing';\n\nexport * from './ops';\n"]}
@@ -0,0 +1,19 @@
1
+ export interface ExtendedError extends Error {
2
+ framesToPop?: number | undefined;
3
+ }
4
+ /**
5
+ * Creates synthetic trace. By default pops 2 frames - `createSyntheticError` and the caller
6
+ */
7
+ export declare function createSyntheticError(framesToPop?: number): ExtendedError;
8
+ /**
9
+ * Returns the number of frames to pop from the stack trace.
10
+ * @param error ExtendedError
11
+ */
12
+ export declare function getFramesToPop(error: ExtendedError): number;
13
+ /**
14
+ * Check if `potentialError` is an object with string stack property.
15
+ */
16
+ export declare function isErrorLike(potentialError: unknown): potentialError is {
17
+ stack: string;
18
+ };
19
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/js/utils/error.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC1C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAQD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,GAAE,MAAU,GAAG,aAAa,CAI3E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,OAAO,GAAG,cAAc,IAAI;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAOxF"}
@@ -0,0 +1,30 @@
1
+ // Sentry Stack Parser is skipping lines not frames
2
+ // https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23
3
+ // 1 for first line with the Error message
4
+ const SENTRY_STACK_PARSER_OFFSET = 1;
5
+ const REMOVE_ERROR_CREATION_FRAMES = 2 + SENTRY_STACK_PARSER_OFFSET;
6
+ /**
7
+ * Creates synthetic trace. By default pops 2 frames - `createSyntheticError` and the caller
8
+ */
9
+ export function createSyntheticError(framesToPop = 0) {
10
+ const error = new Error();
11
+ error.framesToPop = framesToPop + REMOVE_ERROR_CREATION_FRAMES; // Skip createSyntheticError's own stack frame.
12
+ return error;
13
+ }
14
+ /**
15
+ * Returns the number of frames to pop from the stack trace.
16
+ * @param error ExtendedError
17
+ */
18
+ export function getFramesToPop(error) {
19
+ return error.framesToPop !== undefined ? error.framesToPop : 0;
20
+ }
21
+ /**
22
+ * Check if `potentialError` is an object with string stack property.
23
+ */
24
+ export function isErrorLike(potentialError) {
25
+ return (potentialError !== null &&
26
+ typeof potentialError === 'object' &&
27
+ 'stack' in potentialError &&
28
+ typeof potentialError.stack === 'string');
29
+ }
30
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/js/utils/error.ts"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,oIAAoI;AACpI,0CAA0C;AAC1C,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,4BAA4B,GAAG,CAAC,GAAG,0BAA0B,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,cAAsB,CAAC;IAC1D,MAAM,KAAK,GAAkB,IAAI,KAAK,EAAE,CAAC;IACzC,KAAK,CAAC,WAAW,GAAG,WAAW,GAAG,4BAA4B,CAAC,CAAC,+CAA+C;IAC/G,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAoB;IACjD,OAAO,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,cAAuB;IACjD,OAAO,CACL,cAAc,KAAK,IAAI;QACvB,OAAO,cAAc,KAAK,QAAQ;QAClC,OAAO,IAAI,cAAc;QACzB,OAAO,cAAc,CAAC,KAAK,KAAK,QAAQ,CACzC,CAAC;AACJ,CAAC","sourcesContent":["export interface ExtendedError extends Error {\n framesToPop?: number | undefined;\n}\n\n// Sentry Stack Parser is skipping lines not frames\n// https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23\n// 1 for first line with the Error message\nconst SENTRY_STACK_PARSER_OFFSET = 1;\nconst REMOVE_ERROR_CREATION_FRAMES = 2 + SENTRY_STACK_PARSER_OFFSET;\n\n/**\n * Creates synthetic trace. By default pops 2 frames - `createSyntheticError` and the caller\n */\nexport function createSyntheticError(framesToPop: number = 0): ExtendedError {\n const error: ExtendedError = new Error();\n error.framesToPop = framesToPop + REMOVE_ERROR_CREATION_FRAMES; // Skip createSyntheticError's own stack frame.\n return error;\n}\n\n/**\n * Returns the number of frames to pop from the stack trace.\n * @param error ExtendedError\n */\nexport function getFramesToPop(error: ExtendedError): number {\n return error.framesToPop !== undefined ? error.framesToPop : 0;\n}\n\n/**\n * Check if `potentialError` is an object with string stack property.\n */\nexport function isErrorLike(potentialError: unknown): potentialError is { stack: string } {\n return (\n potentialError !== null &&\n typeof potentialError === 'object' &&\n 'stack' in potentialError &&\n typeof potentialError.stack === 'string'\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Converts a Uint8Array or Array of bytes into a string representation of base64.
3
+ */
4
+ export declare function base64StringFromByteArray(uint8: Uint8Array | number[]): string;
5
+ //# sourceMappingURL=fromByteArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromByteArray.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/base64-js/fromByteArray.ts"],"names":[],"mappings":"AA+CA;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM,CAsB9E"}
@@ -0,0 +1,61 @@
1
+ /* eslint-disable */
2
+ // The MIT License (MIT)
3
+ // Copyright (c) 2014 Jameson Little
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ // The above copyright notice and this permission notice shall be included in
11
+ // all copies or substantial portions of the Software.
12
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18
+ // THE SOFTWARE.
19
+ // Adapted from https://github.dev/beatgammit/base64-js/blob/88957c9943c7e2a0f03cdf73e71d579e433627d3/index.js#L119
20
+ const lookup = [];
21
+ const code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
22
+ for (let i = 0, len = code.length; i < len; ++i) {
23
+ lookup[i] = code[i];
24
+ }
25
+ function tripletToBase64(num) {
26
+ return lookup[(num >> 18) & 0x3f] + lookup[(num >> 12) & 0x3f] + lookup[(num >> 6) & 0x3f] + lookup[num & 0x3f];
27
+ }
28
+ function encodeChunk(uint8, start, end) {
29
+ let tmp;
30
+ const output = [];
31
+ for (let i = start; i < end; i += 3) {
32
+ tmp = ((uint8[i] << 16) & 0xff0000) + ((uint8[i + 1] << 8) & 0xff00) + (uint8[i + 2] & 0xff);
33
+ output.push(tripletToBase64(tmp));
34
+ }
35
+ return output.join('');
36
+ }
37
+ /**
38
+ * Converts a Uint8Array or Array of bytes into a string representation of base64.
39
+ */
40
+ export function base64StringFromByteArray(uint8) {
41
+ let tmp;
42
+ const len = uint8.length;
43
+ const extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
44
+ const parts = [];
45
+ const maxChunkLength = 16383; // must be multiple of 3
46
+ // go through the array every three bytes, we'll deal with trailing stuff later
47
+ for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
48
+ parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
49
+ }
50
+ // pad the end with zeros, but make sure to not forget the extra bytes
51
+ if (extraBytes === 1) {
52
+ tmp = uint8[len - 1];
53
+ parts.push(`${lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3f]}==`);
54
+ }
55
+ else if (extraBytes === 2) {
56
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1];
57
+ parts.push(`${lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3f] + lookup[(tmp << 2) & 0x3f]}=`);
58
+ }
59
+ return parts.join('');
60
+ }
61
+ //# sourceMappingURL=fromByteArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromByteArray.js","sourceRoot":"","sources":["../../../../src/js/vendor/base64-js/fromByteArray.ts"],"names":[],"mappings":"AAAA,oBAAoB;AAEpB,wBAAwB;AAExB,oCAAoC;AAEpC,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAE3D,6EAA6E;AAC7E,sDAAsD;AAEtD,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,4EAA4E;AAC5E,gBAAgB;AAEhB,mHAAmH;AAEnH,MAAM,MAAM,GAAa,EAAE,CAAC;AAE5B,MAAM,IAAI,GAAG,kEAAkE,CAAC;AAChF,KAAK,IAAI,CAA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is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n// Adapted from https://github.dev/beatgammit/base64-js/blob/88957c9943c7e2a0f03cdf73e71d579e433627d3/index.js#L119\n\nconst lookup: string[] = [];\n\nconst code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nfor (let i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n}\n\nfunction tripletToBase64(num: number): string {\n return lookup[(num >> 18) & 0x3f] + lookup[(num >> 12) & 0x3f] + lookup[(num >> 6) & 0x3f] + lookup[num & 0x3f];\n}\n\nfunction encodeChunk(uint8: Uint8Array | number[], start: number, end: number): string {\n let tmp;\n const output = [];\n for (let i = start; i < end; i += 3) {\n tmp = ((uint8[i] << 16) & 0xff0000) + ((uint8[i + 1] << 8) & 0xff00) + (uint8[i + 2] & 0xff);\n output.push(tripletToBase64(tmp));\n }\n return output.join('');\n}\n\n/**\n * Converts a Uint8Array or Array of bytes into a string representation of base64.\n */\nexport function base64StringFromByteArray(uint8: Uint8Array | number[]): string {\n let tmp;\n const len = uint8.length;\n const extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n const parts = [];\n const maxChunkLength = 16383; // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(`${lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3f]}==`);\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(`${lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3f] + lookup[(tmp << 2) & 0x3f]}=`);\n }\n\n return parts.join('');\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { base64StringFromByteArray } from './fromByteArray';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/base64-js/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { base64StringFromByteArray } from './fromByteArray';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/js/vendor/base64-js/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { base64StringFromByteArray } from './fromByteArray';\n"]}
@@ -1,2 +1,4 @@
1
1
  export { utf8ToBytes } from './buffer';
2
+ export * from './react-native';
3
+ export { base64StringFromByteArray } from './base64-js';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,2 +1,4 @@
1
1
  export { utf8ToBytes } from './buffer';
2
+ export * from './react-native';
3
+ export { base64StringFromByteArray } from './base64-js';
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { utf8ToBytes } from './buffer';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { utf8ToBytes } from './buffer';\nexport * from './react-native';\nexport { base64StringFromByteArray } from './base64-js';\n"]}
@@ -0,0 +1,27 @@
1
+ export type StackFrame = {
2
+ column?: number;
3
+ file?: string;
4
+ lineNumber?: number;
5
+ methodName: string;
6
+ collapse?: boolean;
7
+ };
8
+ export type CodeFrame = Readonly<{
9
+ content: string;
10
+ location?: {
11
+ [key: string]: unknown;
12
+ row: number;
13
+ column: number;
14
+ };
15
+ fileName: string;
16
+ }>;
17
+ export type SymbolicatedStackTrace = Readonly<{
18
+ stack: Array<StackFrame>;
19
+ codeFrame?: CodeFrame;
20
+ }>;
21
+ export type DevServerInfo = {
22
+ [key: string]: unknown;
23
+ url: string;
24
+ fullBundleUrl?: string;
25
+ bundleLoadedFromServer: boolean;
26
+ };
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/react-native/index.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAGF,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAGH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC,CAAC;AAGH,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;CACjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ // MIT License
2
+ export {};
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/js/vendor/react-native/index.ts"],"names":[],"mappings":"AAAA,cAAc","sourcesContent":["// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L17\nexport type StackFrame = {\n column?: number;\n file?: string;\n lineNumber?: number;\n methodName: string;\n collapse?: boolean;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L17\nexport type CodeFrame = Readonly<{\n content: string;\n location?: {\n [key: string]: unknown;\n row: number;\n column: number;\n };\n fileName: string;\n}>;\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L27\nexport type SymbolicatedStackTrace = Readonly<{\n stack: Array<StackFrame>;\n codeFrame?: CodeFrame;\n}>;\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/getDevServer.js#L17\nexport type DevServerInfo = {\n [key: string]: unknown;\n url: string;\n fullBundleUrl?: string;\n bundleLoadedFromServer: boolean;\n};\n"]}
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "5.14.0";
3
+ export declare const SDK_VERSION = "5.15.0";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
2
2
  export const SDK_NAME = 'sentry.javascript.react-native';
3
- export const SDK_VERSION = '5.14.0';
3
+ export const SDK_VERSION = '5.15.0';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.14.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.15.0';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/js/wrapper.ts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GAAG,IAAI,CAAC;IAC5C,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1E,gBAAgB,IAAI,IAAI,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC,WAAW,IAAI,IAAI,CAAC;IAEpB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IACvD,kBAAkB,IAAI,WAAW,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAErD,cAAc,IAAI,OAAO,CAAC;IAC1B,aAAa,IAAI;QAAE,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC;QAAC,aAAa,CAAC,EAAE,kBAAkB,CAAA;KAAE,GAAG,IAAI,CAAC;IAE9F,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEjD;;OAEG;IACH,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACzF;AAID;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,mBAojBpB,CAAC"}
@@ -3,10 +3,11 @@ import { logger, normalize, SentryError } from '@sentry/utils';
3
3
  import { NativeModules, Platform, TurboModuleRegistry } from 'react-native';
4
4
  import { isHardCrash } from './misc';
5
5
  import { isTurboModuleEnabled } from './utils/environment';
6
- import { utf8ToBytes } from './vendor';
6
+ import { base64StringFromByteArray, utf8ToBytes } from './vendor';
7
7
  const RNSentry = isTurboModuleEnabled()
8
8
  ? TurboModuleRegistry.get('RNSentry')
9
9
  : NativeModules.RNSentry;
10
+ const EOL = utf8ToBytes('\n');
10
11
  /**
11
12
  * Our internal interface for calling native functions
12
13
  */
@@ -39,16 +40,17 @@ export const NATIVE = {
39
40
  if (!this._isModuleLoaded(RNSentry)) {
40
41
  throw this._NativeClientError;
41
42
  }
42
- const [EOL] = utf8ToBytes('\n');
43
43
  const [envelopeHeader, envelopeItems] = envelope;
44
44
  const headerString = JSON.stringify(envelopeHeader);
45
- let envelopeBytes = utf8ToBytes(headerString);
46
- envelopeBytes.push(EOL);
45
+ const headerBytes = utf8ToBytes(headerString);
46
+ let envelopeBytes = new Uint8Array(headerBytes.length + EOL.length);
47
+ envelopeBytes.set(headerBytes);
48
+ envelopeBytes.set(EOL, headerBytes.length);
47
49
  let hardCrashed = false;
48
50
  for (const rawItem of envelopeItems) {
49
51
  const [itemHeader, itemPayload] = this._processItem(rawItem);
50
52
  let bytesContentType;
51
- let bytesPayload = [];
53
+ let bytesPayload;
52
54
  if (typeof itemPayload === 'string') {
53
55
  bytesContentType = 'text/plain';
54
56
  bytesPayload = utf8ToBytes(itemPayload);
@@ -56,7 +58,7 @@ export const NATIVE = {
56
58
  else if (itemPayload instanceof Uint8Array) {
57
59
  bytesContentType =
58
60
  typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/octet-stream';
59
- bytesPayload = [...itemPayload];
61
+ bytesPayload = itemPayload;
60
62
  }
61
63
  else {
62
64
  bytesContentType = 'application/json';
@@ -69,12 +71,16 @@ export const NATIVE = {
69
71
  itemHeader.content_type = bytesContentType;
70
72
  itemHeader.length = bytesPayload.length;
71
73
  const serializedItemHeader = JSON.stringify(itemHeader);
72
- envelopeBytes.push(...utf8ToBytes(serializedItemHeader));
73
- envelopeBytes.push(EOL);
74
- envelopeBytes = envelopeBytes.concat(bytesPayload);
75
- envelopeBytes.push(EOL);
76
- }
77
- yield RNSentry.captureEnvelope(envelopeBytes, { store: hardCrashed });
74
+ const bytesItemHeader = utf8ToBytes(serializedItemHeader);
75
+ const newBytes = new Uint8Array(envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length + EOL.length);
76
+ newBytes.set(envelopeBytes);
77
+ newBytes.set(bytesItemHeader, envelopeBytes.length);
78
+ newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length);
79
+ newBytes.set(bytesPayload, envelopeBytes.length + bytesItemHeader.length + EOL.length);
80
+ newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length);
81
+ envelopeBytes = newBytes;
82
+ }
83
+ yield RNSentry.captureEnvelope(base64StringFromByteArray(envelopeBytes), { store: hardCrashed });
78
84
  });
79
85
  },
80
86
  /**