@@ -81,17 +81,14 @@ function reactNativePlugin(Raven, options, internalDataCallback) {
81
81
Raven . setTransport ( reactNativePlugin . _transport ) ;
82
82
83
83
// Check for a previously persisted payload, and report it.
84
- reactNativePlugin
85
- . _restorePayload ( )
86
- . then ( function ( payload ) {
87
- options . onInitialize && options . onInitialize ( payload ) ;
88
- if ( ! payload ) return ;
89
- Raven . _sendProcessedPayload ( payload , function ( error ) {
90
- if ( error ) return ; // Try again next launch.
91
- reactNativePlugin . _clearPayload ( ) ;
92
- } ) ;
93
- } )
94
- [ 'catch' ] ( function ( ) { } ) ;
84
+ reactNativePlugin . _restorePayload ( ) . then ( function ( payload ) {
85
+ options . onInitialize && options . onInitialize ( payload ) ;
86
+ if ( ! payload ) return ;
87
+ Raven . _sendProcessedPayload ( payload , function ( error ) {
88
+ if ( error ) return ; // Try again next launch.
89
+ reactNativePlugin . _clearPayload ( ) ;
90
+ } ) ;
91
+ } ) [ 'catch' ] ( function ( ) { } ) ;
95
92
96
93
Raven . setShouldSendCallback ( function ( data , originalCallback ) {
97
94
if ( ! ( FATAL_ERROR_KEY in data ) ) {
@@ -102,14 +99,11 @@ function reactNativePlugin(Raven, options, internalDataCallback) {
102
99
var origError = data [ FATAL_ERROR_KEY ] ;
103
100
delete data [ FATAL_ERROR_KEY ] ;
104
101
105
- reactNativePlugin
106
- . _persistPayload ( data )
107
- . then ( function ( ) {
108
- defaultHandler ( origError , true ) ;
109
- handlingFatal = false ; // In case it isn't configured to crash.
110
- return null ;
111
- } )
112
- [ 'catch' ] ( function ( ) { } ) ;
102
+ reactNativePlugin . _persistPayload ( data ) . then ( function ( ) {
103
+ defaultHandler ( origError , true ) ;
104
+ handlingFatal = false ; // In case it isn't configured to crash.
105
+ return null ;
106
+ } ) [ 'catch' ] ( function ( ) { } ) ;
113
107
114
108
return false ; // Do not continue.
115
109
} ) ;
@@ -183,11 +177,11 @@ function reactNativePlugin(Raven, options, internalDataCallback) {
183
177
*/
184
178
reactNativePlugin . _persistPayload = function ( payload ) {
185
179
var AsyncStorage = require ( 'react-native' ) . AsyncStorage ;
186
- return AsyncStorage . setItem ( ASYNC_STORAGE_KEY , JSON . stringify ( payload ) ) [ 'catch' ] (
187
- function ( ) {
188
- return null ;
189
- }
190
- ) ;
180
+ return AsyncStorage . setItem ( ASYNC_STORAGE_KEY , JSON . stringify ( payload ) ) [
181
+ 'catch'
182
+ ] ( function ( ) {
183
+ return null ;
184
+ } ) ;
191
185
} ;
192
186
193
187
/**
@@ -197,13 +191,11 @@ reactNativePlugin._persistPayload = function(payload) {
197
191
*/
198
192
reactNativePlugin . _restorePayload = function ( ) {
199
193
var AsyncStorage = require ( 'react-native' ) . AsyncStorage ;
200
- var promise = AsyncStorage . getItem ( ASYNC_STORAGE_KEY )
201
- . then ( function ( payload ) {
202
- return JSON . parse ( payload ) ;
203
- } )
204
- [ 'catch' ] ( function ( ) {
205
- return null ;
206
- } ) ;
194
+ var promise = AsyncStorage . getItem ( ASYNC_STORAGE_KEY ) . then ( function ( payload ) {
195
+ return JSON . parse ( payload ) ;
196
+ } ) [ 'catch' ] ( function ( ) {
197
+ return null ;
198
+ } ) ;
207
199
// Make sure that we fetch ASAP.
208
200
var RCTAsyncSQLiteStorage = NativeModules . AsyncSQLiteDBStorage ;
209
201
var RCTAsyncRocksDBStorage = NativeModules . AsyncRocksDBStorage ;
@@ -265,7 +257,7 @@ reactNativePlugin._transport = function(options) {
265
257
} ;
266
258
267
259
/**
268
- * Strip device-specific IDs found in culprit and frame filenames
260
+ * Strip device-specific IDs found in transaction and frame filenames
269
261
* when running React Native applications on a physical device.
270
262
*/
271
263
reactNativePlugin . _normalizeData = function ( data , pathStripRe ) {
@@ -277,6 +269,10 @@ reactNativePlugin._normalizeData = function(data, pathStripRe) {
277
269
data . culprit = normalizeUrl ( data . culprit , pathStripRe ) ;
278
270
}
279
271
272
+ if ( data . transaction ) {
273
+ data . transaction = normalizeUrl ( data . transaction , pathStripRe ) ;
274
+ }
275
+
280
276
// NOTE: if data.exception exists, exception.values and exception.values[0] are
281
277
// guaranteed to exist
282
278
var stacktrace =
0 commit comments