getsentry/spotlight

Opening an Error crashes Spotlight

Closed this issue · 9 comments

Environment

Spotlight 0.0.14

Steps to Reproduce

  1. Install Spotlight
  2. Use feat/spotlight branch for sentry-java on an Android project
  3. Start sending an error
  4. Open the error

Expected Result

No crash.

Actual Result

App crashes.

Sentry issue: link

This is due to the stack trace frames, as the filename attribute is not always present:

{
    "filename": "View.java",
    "function": "run",
    "module": "android.view.View$PerformClick",
    "lineno": 29334,
    "native": false
},
{
    "function": "-$$Nest$mperformClickInternal",
    "module": "android.view.View",
    "lineno": 0,
    "native": false
}

Hi @markushi it would be great if you could follow this steps for sampling data https://spotlightjs.com/contribute/development/

And share the txt file created here. It will help us to debug the issue.
Actually, i cannot access the sentry internal link shared above.

Thanks

I think we should ensure that the filename type is optional when we process the event's stack trace. TS should then flag all the places where we currently don't check for definedness of it, just like in this case.

@Shubhdeep12 this is the relevant part in Sentry:
image

I agree that it'd be great to get an error and a transaction envelope into our fixtures to debug this better in the future.

Thanks @Lms24

Let's do it this way - https://github.com/getsentry/sentry/blob/c42c39f15becfbd4113f34942e27f2099a4b0cb8/static/app/components/events/interfaces/frame/defaultTitle/index.tsx#L95

as done in the Sentry app.
In the case of Java, we will prefer the Module name and for others, we'll check for the filename first and then fallback as the module name if the filename is not present.

I'll leave the implementation details up to you but I'd like us to reflect in the Event type definitions (not sure where this is exactly but IIRC we have types within spotlight) that the filename could be missing. We should expect that this property is not always available.

Yes EventFrame was having filename as the required type. made that optional too.

Hi @markushi
This is fixed in latest version of Spotlight.
Please verify.
Thanks

Looking good now! Thanks!
image