feat: preserve sync settings on SSO migration
Description
When migrating a non-SSO Murena account to use SSO, the sync settings for eDrive, Mail, Notes, Contacts, Calendar, and Tasks were not preserved. The sync intervals for Contacts, Calendar, and Tasks were also being reset.
This MR resolves the issue so that the settings and the intervals are preserved.
Screenshots
header | header | header |
---|---|---|
![]() |
![]() |
![]() |
Technical details
When an account is migrated to SSO, the following settings are now carried over from the old account to the new one:
- Sync enabled/disabled status for eDrive, Mail, Notes, Contacts, Calendar, and Tasks.
- Sync interval for Contacts, Calendar, and Tasks.
- Group method for Contacts.
If it's a new account setup, default sync settings will be applied.
Additionally, the logic for handling CardDAV and CalDAV services during account setup has been updated to:
- For existing accounts being migrated: Update the existing service record in the database with the new authentication state and principal.
- For new accounts: Create a new service record.
This commit also addressed the issue where the sync settings for Contacts, Calendar, and Tasks were reset after a device reboot.
Tests
- Log in to non-SSO Murena account in Account Manager.
- Disable one or more sync settings in Account sync.
- Change one or more intervals value and contact group method in Account sync settings.
- Migrate to SSO.
- 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/3531