sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

removeNonSdkFrames behaves incorrectly if the os's user name is sentry

Open buenaflor opened this issue 3 years ago • 1 comments

Platform

iOS

Installed

CocoaPods

Version

7.21.0

Steps to Reproduce

Additional frames in the stacktrace from kotlin using this repo results in those frames being dropped by removeNonSdkFrames due to the macbook's user being sentry

Example: obj.package = /Users/sentry/Library/Developer/CoreSimulator/Devices/081997B2-D114-42E8-95DC-E18939E3B55A/data/Containers/Bundle/Application/E7E6E38F-CA3E-4C5E-91A6-21D83A5BBAD5/iosApp.app/iosApp

Expected Result

Screenshot 2022-07-22 at 02 23 47

Actual Result

image

buenaflor avatar Jul 22 '22 14:07 buenaflor

Is that something you can open a PR @buenaflor ?

Maybe we match sentry but not under /Users/sentry or something?

To be honest I'm not sure why we remove these frames, should we just keep them but mark them as InApp=false?

bruno-garcia avatar Jul 22 '22 14:07 bruno-garcia

We remove them because when creating the stacktrace when capturing events, the stacktrace contains frames from the Cocoa SDK, and this was confusing to users. I think even when we marked them as inApp=false, people were still confused. I think we should change the approach as this only works if you include the SDK dynamically https://github.com/getsentry/sentry-cocoa/blob/953abb7d87f564b438ae6c201574cc4f0e590ce1/Sources/Sentry/include/SentryFrameRemover.h#L15-L16

philipphofmann avatar Aug 29 '22 13:08 philipphofmann

Was fixed with https://github.com/getsentry/sentry-cocoa/pull/2002

philipphofmann avatar Sep 14 '22 13:09 philipphofmann