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

fix: fix SwiftUI mangled names #475

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

TizianoCoroneo
Copy link

@TizianoCoroneo TizianoCoroneo commented Feb 28, 2024

Description

This PR fixes the name mangling of the screen events when the automatic screen tracking tries to capture SwiftUI's views.

The issue was cause by the usage of NSStringFromClass, that takes the unique mangled name of a Swift class as seen from the ObjC runtime. Using Swift's standard library String(describing: type(of: self)) instead returns us the demangled name.

I have implemented this feature on top of the 2.4.3 tag. I'm unsure of what branch to target.

Here's an example:

Before After
Screenshot 2024-02-28 at 15 23 00 Screenshot 2024-02-28 at 15 22 48 LoadingView<ActiveEventsFilters, BrowseEventsView>

@TizianoCoroneo TizianoCoroneo changed the base branch from develop to master-v2 February 28, 2024 14:28
@desusai7
Copy link
Contributor

Hey @TizianoCoroneo,

Thank you for raising this, we will check this out.

@desusai7 desusai7 changed the base branch from master-v2 to develop-v2 February 28, 2024 14:32
@desusai7 desusai7 self-requested a review February 28, 2024 14:32
@TizianoCoroneo TizianoCoroneo changed the title fix: Fix SwiftUI mangled names fix: fix SwiftUI mangled names Feb 28, 2024
@desusai7
Copy link
Contributor

Hey @TizianoCoroneo,

Can you please sign the CLA here to take this forward ?

@TizianoCoroneo
Copy link
Author

Can you please sign the CLA here to take this forward ?

Done!

@desusai7
Copy link
Contributor

Thank you @TizianoCoroneo for signing the CLA, merging this now.

@TizianoCoroneo TizianoCoroneo requested a review from a team as a code owner April 5, 2024 13:24
@desusai7 desusai7 merged commit dbb04b5 into rudderlabs:develop-v2 Apr 5, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants