Skip to content

Updates to session restoration - #1905

Merged
damontecres merged 5 commits into
mainfrom
fea/session-restore
Oct 12, 2026
Merged

damontecres merged 5 commits into
mainfrom
fea/session-restore

Conversation

@damontecres

Copy link
Copy Markdown
Owner

Description

This PR reworks some of the internal handling of changing users and auto sign in.

  1. Most recently used server/user is migrated from AppPreferences to MostRecentServerProvider
  2. Checking if a user profile is protected occurs at a lower level in ServerRepository so fewer services need to check for this
  3. Now always defaults to the most recent server's user list in cases where the most recent user can't be switched to such as if the profile is protected, auto signin is disabled, or and error occurred

The default implementation for MostRecentServerProvider uses Android's SharedPreferences. SharedPreferences was already was being used to track the most recent server for crash reporting (the crash reporting process cannot use the Hilt DI). This PR enhances this and adds a better API for saving/retrieving.

This also removes the last bit of "user specific" data from AppPreferences.

Related issues

None specific, but there have been a few related to auto sign-in & intents that were recently fixed. This PR is a more detailed approach to those same problems.

Testing

Manually via the emulator. There are also unit tests for most (all?) of the different settings and state combinations.

Screenshots

N/A

AI or LLM usage

None

@damontecres damontecres added the dev Related to development of the project label Aug 26, 2026
@damontecres damontecres added this to the Next minor release milestone Oct 8, 2026
@damontecres
damontecres merged commit f01c5d3 into main Oct 12, 2026
2 checks passed
@damontecres
damontecres deleted the fea/session-restore branch October 12, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev Related to development of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant