Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Backgrounding app artificially inflates session duration by value of SESSION_DURATION #48

Open
garyhogarth opened this issue Oct 18, 2018 · 4 comments
Assignees

Comments

@garyhogarth
Copy link

The way that the app state change is handled, it fires a session_stop event when backgrounding the app, if you bring the app to the foreground it sends a subsequent session_start event.

If you do this during the time defined in SESSION_DURATION (default: 60 seconds), it seems like the count.ly servers consider this the same session (this is good). However when viewing the dashboard I observer the session_stop event has increased the "duration" of the session by 60 seconds.

I guess you can see where I am going here, and this may be only an issue with the UI of count.ly rather than this SDK. If I sit there and constantly background and foreground the app my session duration goes through the roof.

Example: I took this screenshot at 15:38 however the session started at 15:37 is already 17 minutes long.

image

@trinisofttechnologies
Copy link
Contributor

Hi Gorkem,

Can you add Artem in this thread?
As this issue is partially related to the SDK.
and partially with server background.

@gorkem-cetin

Thanks

@gorkem-cetin
Copy link
Contributor

Sure.. @iartem what do you think?

@iartem
Copy link

iartem commented Feb 20, 2019

@trinisofttechnologies it's not related to the server whatsoever. React SDK doesn't even calculate the time spent in the foreground, it just always sends session interval as duration (default value is 60 seconds). Even on end_session irrespective the moment it is called. https://github.com/Countly/countly-sdk-react-native/blob/master/Countly.js#L395

@iartem iartem removed their assignment Feb 20, 2019
@trinisofttechnologies
Copy link
Contributor

Ok will continue to review on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants