getsentry / team-webplatform-meta

0 stars 0 forks source link

Validate stack frame ordering and trimming #44

Closed mattjohnsonpint closed 1 year ago

mattjohnsonpint commented 1 year ago

Per client-infra discussion, we need to validate that all SDKs are sending stack frames in the correct order.

Per dev docs

The list is ordered from caller to callee, or oldest to youngest. The last frame is the one creating the exception.

As an example, if A() invokes B() invokes C() and C throws an exception (or is the active call site if there is no exception), then the sequence of frames should be [A,B,C].

This matters because some features may need to consider the "first in-app frame", and the sequence may change the definition of "first".

If any of the SDKs are currently ordering the frames as [C,B,A], then we may need to have relay reverse them based on either a flag or SDK version.

Additionally - if your SDK is trimming frames, it should trim them from the top of the list, such that the frame that throws the exception is retained. For example, if [A,B,C,...,X,Y,Z] needed to be trimmed, you would remove entries starting with A.

Please validate in your SDK, and check the box if frames are sequenced correctly. Leave a comment if they are not. Thanks!

mattjohnsonpint commented 1 year ago

Mobile SDKs: https://github.com/getsentry/team-mobile/issues/103

smeubank commented 1 year ago

@HazAT let's make sure we have a look at this for webSDKs

mattjohnsonpint commented 1 year ago

Please validate trimming behavior as well. See updated description at top of this issue. Thanks.

smeubank commented 1 year ago

If I remember well, I think this is fine and it was more of sanity check assignment for SDKs, potentially stack trace team could just validate if this a real issue anymore