Pre loaded UIViewController transactions might be finished way too late
Description
UIViewControllers can be preloaded, meaning calling the lifecycle methods up to viewDidLoad or even further. They can stick around for a while before they actually get fully loaded. This could lead to auto-generated transactions with a way too long duration.
Auto-generated transactions lasting longer than 5 minutes already get discarded with https://github.com/getsentry/sentry-cocoa/pull/1903.
Users may even start some view controller before any other view controller but not attached it to the view hierarch, so this could end up in the scope "intercepting" every other new span and never finish, or finish way later.
One idea, from @brustolin, is to ignore UIViewControllers initialized outside the view hierarchy. We can detect this by checking parentViewController and/or viewParentView.
We could end these UIViewController transactions early or find another point of time to finish them not to discard them.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀