-
Notifications
You must be signed in to change notification settings - Fork 49
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 Id didn't rotate after 23 hours #227
Comments
@marandaneto any ideas on what could be going on here? Especially last part of my comment above - leads me to think that these could be events in the queue with the wrong timestamp somehow |
I think the problem is that the |
Another point is that we capture a |
https://github.com/PostHog/posthog-js/blob/a6655acf6910ecea144758b89358311797604941/src/sessionid.ts#L15
|
#227 (comment) I think this is an improvement for sure, but I don't think it's the cause of the issue. Whenever the event was captured, it was captured along with the correct session_id that we only assign in capture() for
|
Finally making some headway here! After watching a bunch of recordings, I think I have an idea of what could be going on. I noticed quite a few recordings had this pattern where We’re currently observing Here are a few ideas on how to handle this:
|
we only do that for |
Curious about that, I recall testing this in the past but happy to be wrong here. |
That is a good point, |
Yeah, true actually, but if this is called when already in background, it will unintentionally extend the session time right? |
I assume the app is in the foreground if |
I tried testing my assumption locally but without any success. Notifications appear to work as expected, at least on the latest iOS in both the simulator and on a real device. My testing involved simulating a background fetch on both platforms, but I couldn’t test remote push notifications since they require a developer account setup. So I'm not sure how remote would behave in this case. It seems like events are picking up an old |
@marandaneto any more insights from the other user you mentioned having this problem? |
discussed offline, and shared some links, but not more than that. |
Description
A user reported that a session recording lasted for around 24 hours. After taking a look at the recording, we do indeed capture a few snapshots at the very end of the recording (timestamps look correct), right before the session is rotated.
This is weird cause we clear the session_id on every capture here and rotate it after about 30 mins when the app is foregrounded here.
Also, session id/window id is managed only in memory, so it's very unlikely that the OS suspended the app but didn't terminate it for 23 hours.
From: https://posthoghelp.zendesk.com/agent/tickets/19974
The text was updated successfully, but these errors were encountered: