Draft: fix: remove Mail account on SSO logout
Description
When logging out from AccountManager using SSO, the associated Mail account was not being removed whereas for non-SSO it was being removed as expected.
The 'AccountManager.KEY_ACCOUNT_NAME' intent extra contains the username part of the email address (e.g., 'username' from username@example.com
).
For non-SSO accounts, accountName and email used to be the same. However, for SSO accounts, the accountName contains only the username part of the email address.
This commit updates the logic to find the matching account by comparing this username with the username part of the account's email address. Previously, it attempted to match the full email address with just the username, which would always fail.
Screenshots
Technical details
Tests
Issues
https://gitlab.e.foundation/e/os/backlog/-/issues/3485
10 commandments of code review
Summary by CodeRabbit
-
Refactor
- Enhanced account synchronization by matching only the prefix of email addresses, improving account identification flexibility.