Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode Swift type names #1980

Closed
lhunath opened this issue Jul 14, 2022 · 7 comments · Fixed by #2162
Closed

Decode Swift type names #1980

lhunath opened this issue Jul 14, 2022 · 7 comments · Fixed by #2162

Comments

@lhunath
Copy link
Contributor

lhunath commented Jul 14, 2022

Problem Statement

Our error reports are full of mentions such as:

EXC_BAD_ACCESS _TtCVV8HubstaffP33_25DEF6E1EA93D46FE809017E6DD99DCF21NavigatingStackScreen30NavigationBarConfigurationView14ViewController

This is very user-unfriendly and there is no reason to leave obfuscated type names in public-facing titles like this. It would be great if Sentry could decode these type names into something more user-friendly.

Solution Brainstorm

Here's some code to kick-start you on this journey:
https://gitlab.com/spectre.app/ios/-/blob/main/Sources/Util/Describe.swift#L34

@getsentry-release
Copy link
Collaborator

Routing to @getsentry/team-mobile for triage. ⏲️

@brustolin
Copy link
Contributor

Hello @lhunath. We are aware of this and are working to resolve it.

@bruno-garcia
Copy link
Member

So far Sentry only does demanging on the server through symbolic. @brustolin is exploring a way to demangle client side but we're afraid that might bloat the SDK, unsure at this point.

@armcknight
Copy link
Member

What is the rationale to do this client side vs server side?

@lhunath
Copy link
Contributor Author

lhunath commented Aug 2, 2022

do you need access to the runtime for reflection? I wouldn't expect so.

@brustolin
Copy link
Contributor

What is the rationale to do this client side vs server side?

Flexibility. We don't need to wait for a server side update every time we use a class name in a description or extra information.

Local log during debug.

And @bruno-garcia mentioned something about this being necessary for Dynamic Sampling.

do you need access to the runtime for reflection? I wouldn't expect so.

Nope. The mangled name has a logic, we just need to parse it.

You can follow all the findings in this PR #2033

@kevinrenskers
Copy link
Contributor

This was done in #2162, which is part of the upcoming 8.0.0 release. You can test the beta version of this release already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment