File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,12 @@ export class InboundFilters implements Integration {
178
178
try {
179
179
if ( event . stacktrace ) {
180
180
// tslint:disable-next-line:no-unsafe-any
181
- return ( event as any ) . stacktrace . frames [ 0 ] . filename ;
181
+ const frames = ( event as any ) . stacktrace . frames ;
182
+ return frames [ frames . length - 1 ] . filename ;
182
183
} else if ( event . exception ) {
183
184
// tslint:disable-next-line:no-unsafe-any
184
- return ( event as any ) . exception . values [ 0 ] . stacktrace . frames [ 0 ] . filename ;
185
+ const frames = ( event as any ) . exception . values [ 0 ] . stacktrace . frames ;
186
+ return frames [ frames . length - 1 ] . filename ;
185
187
} else {
186
188
return null ;
187
189
}
Original file line number Diff line number Diff line change @@ -255,18 +255,28 @@ describe('InboundFilters', () => {
255
255
const messageEvent = {
256
256
message : 'wat' ,
257
257
stacktrace : {
258
+ // Frames are always in the reverse order, as this is how Sentry expect them to come.
259
+ // Frame that crashed is the last one, the one from awesome-analytics
258
260
frames : [
259
- {
260
- filename : 'https://awesome-analytics.io/some/file .js' ,
261
- } ,
261
+ { filename : 'https://our-side.com/js/bundle.js' } ,
262
+ { filename : 'https://our-side.com/js/bundle .js' } ,
263
+ { filename : 'https://awesome-analytics.io/some/file.js' } ,
262
264
] ,
263
265
} ,
264
266
} ;
265
267
const exceptionEvent = {
266
268
exception : {
267
269
values : [
268
270
{
269
- stacktrace : { frames : [ { filename : 'https://awesome-analytics.io/some/file.js' } ] } ,
271
+ stacktrace : {
272
+ // Frames are always in the reverse order, as this is how Sentry expect them to come.
273
+ // Frame that crashed is the last one, the one from awesome-analytics
274
+ frames : [
275
+ { filename : 'https://our-side.com/js/bundle.js' } ,
276
+ { filename : 'https://our-side.com/js/bundle.js' } ,
277
+ { filename : 'https://awesome-analytics.io/some/file.js' } ,
278
+ ] ,
279
+ } ,
270
280
} ,
271
281
] ,
272
282
} ,
You can’t perform that action at this time.
0 commit comments