You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! This works flawlessly except for a sporadic vertical shift glitch on Android. Sporadically the whole screen shifts up and down for a few milliseconds. I think it gets more triggered when I interact with any react navigation component. Could be caused by safe areas, as I think the vertical shift corresponds with the size of the top safe area.
The diagnosis was quite simple, if I install this library the glitch happens on some Android devices (Pixel 6a for example), if I uninstall it the issue is resolved. I think it only happens on some Android devices because on the other devices (older ones) the package doesn't even get installed as the android sdk version requirements are too new.
Attaching my current package.json and a video of the glitch. package.json
hello @joaqo thanks for the issue.
Can you try to disable for example maskAllTextInputs and maskAllImages and see if it helps? So we can narrow down the masking feature.
The other test is to increase the androidDebouncerDelayMs from 1000 to eg 3000 and see if it helps.
Read more about the configs here.
Does it happen on other screens without a listview?
I already had those settings disabled, tried increasing androidDebouncerDelayMs to 3000 (had it at 500) and it improved considerably in how often it happens, but its still present.
Does it happen on other screens without a listview?
I am not sure, as most of my views have lists and the glitch is sporadic, but its very possible that it doesn't.
These are my current posthog settings:
{host: "https://us.i.posthog.com",// disabled: __DEV__,enableSessionReplay: Platform.OS==="ios",// I turned this on an android for the tests ofcoursesessionReplayConfig: {// Whether text inputs are masked. Default is true.// Password inputs are always masked regardlessmaskAllTextInputs: false,// Whether images are masked. Default is true.maskAllImages: false,// Capture logs automatically. Default is true.// Android only (Native Logcat only)captureLog: true,// Whether network requests are captured in recordings. Default is true// Only metric-like data like speed, size, and response code are captured.// No data is captured from the request or response body.// iOS onlycaptureNetworkTelemetry: true,// Deboucer delay used to reduce the number of snapshots captured and reduce performance impact. Default is 500msandroidDebouncerDelayMs: 500,// Deboucer delay used to reduce the number of snapshots captured and reduce performance impact. Default is 1000msiOSdebouncerDelayMs: 1000,},
@joaqo which version of the SDK? androidDebouncerDelayMs is 1000 by default now to avoid the performance hit.
there were a few improvements in the latest versions, so maybe try using the latest version?
@joaqo can you provide a MRE? I have a sample app with list views but I don't notice it, either your app does way more things on the listview or it depends on the tested device/emulator.
I'm using the default values for androidDebouncerDelayMs (1s), latest version.
Regrettably I don't have a MRE. I might be able to extract one in January when things slow down for us a bit. But the component this happens in is not really too complex, just a react navigation tab-view with a react navigation native top tab bar inside it which is what you see in the video is scrolling. Inside it a scrollview populated by react-native-firebase. It happens in real world devices in prod, not just in simulators. Turning off react-native-session-replay completely fixes it.
Don't think I'm being too helpful unfortunately, but still please don't hesitate to ask anything, I'll do my best to help.
hey @joaqo since I cannot reproduce this issue, mind running a test for us?
There was this issue on iOS and I wonder if this is affecting Android as well.
Apparently the Android code does something similar, also here.
What I'd like you to do is to add an accessibilityLabel in your components (all if possible), which can be anything such as test, and try to reproduce the performance hit again.
That will likely make the method to return early instead of looping all the children in the view tree, maybe this is the very same issue as on iOS.
Hey @marandaneto , that sounds like something I can do!
Just to confirm though, you want me to add something like accessibilityLabel="test" to every component in my app? As in, every View, Text, Image, etc? Cause we're probably talking thousands of components here, isn't there any way I could focus on a certain subset and still be effective?
Just tried it, it does seem to help quite a bit, but doesn't completely fix it.
Before applying this I could scroll up and down on the scrollview continuously and I got the glitch once every 20 seconds or so (it used to be much more often before I increased the debouncer time as originally suggested), after applying your suggestion I can only get the glitch once after about 30 seconds from first app cold start, and then never again basically.
@joaqo sorry for the late reply, the code paths I shared aren't even triggered when using a FlatList for example.
Please extract an MRE so I can reproduce the issue, otherwise, I feel like it runs pretty smooth for these use cases with or without the accessibilityLabel, and thanks for debugging this with me.
Closing the issue as a part of large repository cleanup, due to it being inactive and/or outdated.
Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it.
Cheers!
I installed the latest versions for Posthog yesterday to our React Native Expo project, and now see this same issue on Android. I tracked this down to the react native safe area context, which on my device returns bottom zero, then suddenly going from zero to 48 and back again, which is the cause of this vertical glitch (I also once saw top go from 0 to 506 and back to 0).
I attempted the work-around by debouncing offsets, which seemed to work in a dev build, but issues still occurred in a production build. At the moment we are going to have to only use Posthog for iOS due to these issues, so it would be great if you could reopen and look into a fix. I found that if you swipe up and down a lot on an Android app, it makes the issue more prominent.
Thanks.
Yep, just to confirm that I am still seeing this issue. I removed all calls to safe area which greatly improved it, but I am using react navigation, which contains some safe areas I can't access, so I still see the issue though more sporadically.
We are also using react navigation. Not using safe area offsets is not really an option, so currently I am having to do iOS only by providing disabled: Platform.OS === 'android', to Posthog. Unfortunately a large number of customers we are unable to get user activity for.
just getting this issue too. definitely still present. dont have MRE yet, might be able to work on one later and maybe at that point we can reopen, but for now interesting clue is that debouncing useSafeAreaInsets() had a massive improvement
Activity
marandaneto commentedon Nov 14, 2024
hello @joaqo thanks for the issue.
Can you try to disable for example
maskAllTextInputsandmaskAllImagesand see if it helps? So we can narrow down the masking feature.The other test is to increase the
androidDebouncerDelayMsfrom 1000 to eg 3000 and see if it helps.Read more about the configs here.
Does it happen on other screens without a listview?
joaqo commentedon Nov 14, 2024
Hi, thanks for the help!
I already had those settings disabled, tried increasing androidDebouncerDelayMs to 3000 (had it at 500) and it improved considerably in how often it happens, but its still present.
I am not sure, as most of my views have lists and the glitch is sporadic, but its very possible that it doesn't.
These are my current posthog settings:
marandaneto commentedon Nov 14, 2024
@joaqo which version of the SDK?
androidDebouncerDelayMsis 1000 by default now to avoid the performance hit.there were a few improvements in the latest versions, so maybe try using the latest version?
joaqo commentedon Nov 14, 2024
I'm was using
Just updated to 0.1.6 and set the debounce to 1000ms. It improved quite a bit, but the issue is still present although more sporadically.
marandaneto commentedon Nov 18, 2024
@joaqo can you provide a MRE? I have a sample app with list views but I don't notice it, either your app does way more things on the listview or it depends on the tested device/emulator.
I'm using the default values for androidDebouncerDelayMs (1s), latest version.
joaqo commentedon Nov 19, 2024
Regrettably I don't have a MRE. I might be able to extract one in January when things slow down for us a bit. But the component this happens in is not really too complex, just a react navigation tab-view with a react navigation native top tab bar inside it which is what you see in the video is scrolling. Inside it a scrollview populated by react-native-firebase. It happens in real world devices in prod, not just in simulators. Turning off react-native-session-replay completely fixes it.
Don't think I'm being too helpful unfortunately, but still please don't hesitate to ask anything, I'll do my best to help.
marandaneto commentedon Nov 25, 2024
hey @joaqo since I cannot reproduce this issue, mind running a test for us?
There was this issue on iOS and I wonder if this is affecting Android as well.
Apparently the Android code does something similar, also here.
What I'd like you to do is to add an accessibilityLabel in your components (all if possible), which can be anything such as
test, and try to reproduce the performance hit again.That will likely make the method to return early instead of looping all the children in the view tree, maybe this is the very same issue as on iOS.
Let me know if that improves anything, thanks.
joaqo commentedon Nov 27, 2024
Hey @marandaneto , that sounds like something I can do!
Just to confirm though, you want me to add something like
accessibilityLabel="test"to every component in my app? As in, every View, Text, Image, etc? Cause we're probably talking thousands of components here, isn't there any way I could focus on a certain subset and still be effective?marandaneto commentedon Nov 27, 2024
Only the screen you are experiencing the issue, the one with list view.
joaqo commentedon Nov 27, 2024
Just tried it, it does seem to help quite a bit, but doesn't completely fix it.
Before applying this I could scroll up and down on the scrollview continuously and I got the glitch once every 20 seconds or so (it used to be much more often before I increased the debouncer time as originally suggested), after applying your suggestion I can only get the glitch once after about 30 seconds from first app cold start, and then never again basically.
Hope this helps.
marandaneto commentedon Nov 28, 2024
That is good info, step by step, I will look into it, thanks
marandaneto commentedon Dec 5, 2024
@joaqo sorry for the late reply, the code paths I shared aren't even triggered when using a
FlatListfor example.Please extract an MRE so I can reproduce the issue, otherwise, I feel like it runs pretty smooth for these use cases with or without the
accessibilityLabel, and thanks for debugging this with me.joaqo commentedon Dec 6, 2024
Hi @marandaneto. Got it. We are using ScrollView, not flat list though, not sure if that changes anything. Also, we're using it inside one of these: https://reactnavigation.org/docs/material-top-tab-navigator/ with a custom tab header.
I'll maybe be able to extract an MRE early 2025, regrettably I wont be able to enable session recording on Android for the time being.
Thank you for your help,
Joaquín
marandaneto commentedon Jul 31, 2025
Closing the issue as a part of large repository cleanup, due to it being inactive and/or outdated.
Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it.
Cheers!
ghcassell commentedon Sep 3, 2025
I installed the latest versions for Posthog yesterday to our React Native Expo project, and now see this same issue on Android. I tracked this down to the react native safe area context, which on my device returns
bottomzero, then suddenly going from zero to 48 and back again, which is the cause of this vertical glitch (I also once sawtopgo from 0 to 506 and back to 0).@joaqo @marandaneto
ghcassell commentedon Sep 5, 2025
I attempted the work-around by debouncing offsets, which seemed to work in a dev build, but issues still occurred in a production build. At the moment we are going to have to only use Posthog for iOS due to these issues, so it would be great if you could reopen and look into a fix. I found that if you swipe up and down a lot on an Android app, it makes the issue more prominent.
Thanks.
joaqo commentedon Sep 9, 2025
Yep, just to confirm that I am still seeing this issue. I removed all calls to safe area which greatly improved it, but I am using react navigation, which contains some safe areas I can't access, so I still see the issue though more sporadically.
ghcassell commentedon Sep 9, 2025
We are also using react navigation. Not using safe area offsets is not really an option, so currently I am having to do iOS only by providing
disabled: Platform.OS === 'android',to Posthog. Unfortunately a large number of customers we are unable to get user activity for.marandaneto commentedon Sep 9, 2025
Hey, everyone, as I mentioned a couple of times, I need an MRE; otherwise, I cannot proceed, since I've tried many times and couldn't reproduce it.
adpadillar commentedon Feb 18, 2026
just getting this issue too. definitely still present. dont have MRE yet, might be able to work on one later and maybe at that point we can reopen, but for now interesting clue is that debouncing useSafeAreaInsets() had a massive improvement
Nezz commentedon Feb 24, 2026
I came across this issue too on Android with Posthog session replay enabled
Nezz commentedon Feb 24, 2026
Opened a ticket with a MRE