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

Migrate user account management to UserAccountManager #4676

Open
3 of 7 tasks
ezaquarii opened this issue Oct 13, 2019 · 1 comment
Open
3 of 7 tasks

Migrate user account management to UserAccountManager #4676

ezaquarii opened this issue Oct 13, 2019 · 1 comment
Assignees

Comments

@ezaquarii
Copy link
Collaborator

ezaquarii commented Oct 13, 2019

Situation

Currently user account can be represented by 4 different types:

  • android.accounts.Account
  • com.owncloud.android.lib.common.OwnCloudAccount
  • String id
  • int id

Accounts are being juggled in activities that try to track which account is currently active and perform ad-hoc reinitialization of UI on change.

The logic responsible for reconciliation of currently selected account and UI state is virtually impossible to track due to large amount of flags, conditions and out-of-band state modification.

Additionally, we discovered some issues with android account manager, causing accounts to disappear from the android.accounts.AccountManager on phones that allow installing the application on external storage (despite we forbid it in the manifest).

Solution

  1. Make UserAccountManager a single point of truth regarding currently selected account
  2. Eliminate ad-hoc UI patching in life cycle callbacks
  3. Seal OwnCloudAccount and Account behind new unified interface
  4. Migrate application components to new unified account type

No visible user impact, or impact minimized up to this point.

  1. Make decision about new account manager implementation (platform? custom? library? app? sso?)

Roadmap

Due to current state of code, extensive refactoring and cleanup around account handling is necessary, as it contains too much state mutation dispersed through many functional areas.
Managing risk in such environment is not economical.

Proposal (incomplete):

@tobiasKaminsky
Copy link
Member

Very good approach!
I guess the idea of OwnCloudAccount is to handle the most basic infos within library, so that other apps can also use this. Something similar is OCFile (in our app) vs RemoteFile (in library) for representing a server file.

@AndyScherzinger AndyScherzinger removed their assignment Apr 1, 2022
@joshtrichards joshtrichards added the feature: authentication Authentication or accounts related label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants