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

Add an option to continue previously persisted session when the app restarts rather than starting a new one #912

Merged
merged 4 commits into from
Feb 10, 2025

Conversation

matus-tomlein
Copy link
Contributor

Adds an option to continue the previously persisted session when the app restarts.

The default behaviour is to always start a new session when a new tracker is created (i.e., when the app restarts) regardless of whether the previous one timed out or not.

With the option enabled, every session update is persisted to the UserDefaults storage. This includes the current event index in the session and a timestamp of the last update of the session. In case it's disabled, only session changes are persisted to UserDefaults.

The option can be configured using SessionConfiguration:

        let sessionConfig = SessionConfiguration()
            .continueSessionOnRestart(true)

@mscwilson mscwilson changed the base branch from master to release/6.1.0 December 16, 2024 10:29
Copy link
Contributor

@mscwilson mscwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@matus-tomlein matus-tomlein changed the base branch from release/6.1.0 to release/6.2.0 February 7, 2025 13:10
@matus-tomlein matus-tomlein force-pushed the issue/continue_session_on_restart branch from 3cd8e12 to 2b4443c Compare February 10, 2025 09:53
@matus-tomlein matus-tomlein merged commit 53881e5 into release/6.2.0 Feb 10, 2025
5 of 10 checks passed
@matus-tomlein matus-tomlein deleted the issue/continue_session_on_restart branch February 10, 2025 09:54
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