Skip to content
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

Improve end session event #124

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Improve end session event #124

wants to merge 7 commits into from

Conversation

djih
Copy link
Member

@djih djih commented Nov 30, 2016

This addresses the issue when the end session event is logged on app open and the latest app state is logged (for example the app version name), with the old timestamp, resulting in events for certain app versions being logged before the version was actually released.

When app goes into background, we log an end session event and save it to the key value table (with session_end as the key). This end session event is timestamped at the time the app goes into the background.

When app comes into foreground and starts a new session, it checks the key value table for any saved end session events. If there isn't one, it logs one at that time (the old behavior) which will go to the key value table. It then reloads the saved end session event and just adds it to the events table.

We sanity check the saved end session event and make sure that its timestamp is the same as the last recorded time (when app went into background).

This change should not break any existing tests since the fallback behavior is just the old behavior.

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

Successfully merging this pull request may close these issues.

2 participants