fix: preserve sync settings on re-auth for OAuth accounts
Description
The re-authentication flow for OAuth accounts used to reset every sync settings and start with defaults. This commit fixes the behaviour so that on re-auth, the settings are preserved.
It uses the same flow for Murena account's SSO migration as the settings are saved too during the migration.
For more details, see this MR: !165 (merged)
Screenshots
![]() |
![]() |
Tests
- Log in to Google, Yahoo or SSO-enabled Murena account.
- Disable one or more sync settings in Account Settings screen.
- Change one or more intervals value and contact group method in Account sync screen.
- Perform a re-authentication from Account sync screen.
- Observe that sync settings are preserved.
- Observe that sync interval and contact group methods are preserved.
- Observe that after a reboot, the sync settings are preserved.
Issues
https://gitlab.e.foundation/e/os/backlog/-/issues/3535
10 commandments of code review
Summary by CodeRabbit
- New Features
- Clearer account setup/upsert flow that explicitly handles Basic Authentication alongside OAuth/OpenID, simplifying create/update behavior.
- Bug Fixes
- More reliable detection and handling of OAuth vs BasicAuth accounts to avoid auth-state mistakes.
- Consistent migration and sync configuration when updating accounts, reducing setup and sync errors.
Edited by CodeRabbitAI