-
Notifications
You must be signed in to change notification settings - Fork 92
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
Bundle Path Check Fails for Modularized App Structures on Real iOS Devices #858
Labels
type:defect
Bugs or weaknesses. The issue has to contain steps to reproduce.
Milestone
Comments
mylifeasdog
added a commit
to mylifeasdog/snowplow-ios-tracker
that referenced
this issue
Jan 18, 2024
mylifeasdog
added a commit
to mylifeasdog/snowplow-ios-tracker
that referenced
this issue
Jan 18, 2024
mylifeasdog
added a commit
to mylifeasdog/snowplow-ios-tracker
that referenced
this issue
Jan 18, 2024
mylifeasdog
added a commit
to mylifeasdog/snowplow-ios-tracker
that referenced
this issue
Jan 18, 2024
matus-tomlein
pushed a commit
that referenced
this issue
Jan 19, 2024
matus-tomlein
pushed a commit
that referenced
this issue
Jan 19, 2024
matus-tomlein
pushed a commit
that referenced
this issue
Jan 19, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The current implementation of
UIViewController
extension in Snowplow SDK uses a method swizzling technique to track screen views. It checks the bundle path to differentiate between the main app and system view controllers. However, in modularized app structures where different components of the app are separated into dynamic frameworks, this check fails on actual iOS devices. This is because the symbolic link between/private/var/
and/var/
leads to the main app bundle and framework bundles being treated differently, affecting tracking accuracy.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The Snowplow SDK should consistently track screen views across all parts of a modularized app, on both iOS simulators and actual devices. Specifically:
/private/var/
and/var/
are effectively the same due to symbolic linking, which is not accounted for in the current implementation.Screenshots
![Screenshot 2024-01-18 at 14 23 37](https://private-user-images.githubusercontent.com/749739/297658360-fb11b94d-d78f-4616-b9af-c540fc5e4bab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50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wODI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNVQwMTU0NDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05MTI0YjE0MDcwYTc5MjE0NjkzODgxZWJiNDI3ODFjNWQ4ZjI2M2YyODZlY2M2YTEwYTU4N2QyZjU5ZjM2ZTY3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.GuHlMiCAAb43NbZtqxTJnBBxypFuHyHkaMdnnBe-uWg)
Device information:
Additional context
The issue seems to stem from the method
sp_viewDidAppear
in the SDK, which checks the bundle path prefix to filter out system view controllers. On real iOS devices, due to the symbolic link in the file system, this check incorrectly filters out view controllers from dynamically loaded frameworks. Specifically, the main app bundle path starting with/private/var/
and the dynamic framework paths starting with/var/
actually refer to the same physical location on the device's file system. This similarity in paths should be accounted for in the SDK's path check logic. A proposed solution involves modifying the path check to account for symbolic links and standardizing the paths before comparison.The text was updated successfully, but these errors were encountered: