-
Notifications
You must be signed in to change notification settings - Fork 43
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
Session replay with screenshot mode turned on forces SwiftUI redrawing #151
Comments
hey @NickAtGit sorry about that and thanks for reporting this issue. |
Thanks! An easy workaround would be to pause the session recording for some views. That would already help a lot... |
@NickAtGit that would be possible per Activity, but for the Single activity apps approach not really. We are still trying to optimize a few things such as the redimensioning of the screenshot out of the main thread (the screenshot has to be in the main thread though) and converting to base64, also increasing the interval from 500ms to 1s, I believe those would make much better for apps that is constantly redrawing the UI such as transitions and animations. |
@marandaneto we are speaking about iOS. There are no activities here ;) |
Ops sorry, indeed, but that applies to iOS as well, on SwiftUI for example, the screen names are auto-generated, so that would not work unless you pass a list of types during the SDK init, will take a look. |
@NickAtGit I have made some improvements, would you mind trying out https://github.com/PostHog/posthog-ios/releases/tag/3.7.1 ? Right now the screenshot is taken every ~500ms, you can increase this time interval to minimize even further the performance hit by setting this:
|
Hi @marandaneto not sure if that helps in that case. Did you try the provided test project with PostHog? It's not about the performance. It is about PostHog sessionReplay triggering constant redraws on wrapped UIKit views. I would like to pause the sessionReplay on some views to prevent that. |
@NickAtGit I created this issue for the screen-by-screen basis #160 |
Hey, I saw your update - unfortunately it doesn't fix my problem. I am using some animations lately in my app and I found that PostHog session replay seems to mess them up. Animations feel stuttery and this is unfortunately a show stopper to me. |
I also played around with the wireframe mode, however I just see blank videos in the PostHog session replay. Is there something I need to do to see them? |
@NickAtGit wireframe isn't supported for SwiftUI |
thanks for testing, I believe this should improve considerably more #166 |
@NickAtGit I made new changes and tested using your app, the fortune sheel feels smooth, would you like to give it another try? https://github.com/PostHog/posthog-ios/releases/tag/3.7.2 |
Yes @marandaneto it is much better now. Thanks for fixing it! One thing you should put in the documentation: Wireframes don't not work in SwiftUI because that was not clear to me. |
Thanks |
Good point, will make sure yo update this as well, thanks |
Version
3.6.1
Steps to Reproduce
When using the provided SwiftUI example of the SwiftFortuneWheel package with PostHog integrated and session replay with screenshot mode turned on then the example project behaves strangely. When turning off screenshot mode it works as expected.
https://github.com/sh-khashimov/SwiftFortuneWheel
Expected Result
The wheel should spin smoothly and come to an end.
Actual Result
The wheel stops abruptly and the console spams some warnings. I guess some constant SwiftUI redrawing is causing the issue.
ScreenRecording_08-01-2024.02-12-06_1.MP4
The text was updated successfully, but these errors were encountered: