Skip to content

Fixed issue of unable to switch on the passwords sync on Android #26876

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

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

AlexeyBarabash
Copy link
Contributor

@AlexeyBarabash AlexeyBarabash commented Dec 5, 2024

At this PR overridden SyncPrefs::SetPasswordSyncAllowed to keep password_sync_allowed_ always true; this fixed issue of unable to switch on the passwords sync on Android.

For the migration of passwords into Google Account upstream disables syncing of passwords. This is managed by
kPasswordsUseUPMLocalAndSeparateStores pref with values

enum class UseUpmLocalAndSeparateStoresState {
  kOff = 0,
  kOffAndMigrationPending = 1,
  kOn = 2,
  kMaxValue = kOn
};

During the start of the sync service kPasswordsUseUPMLocalAndSeparateStores is checked at
ChromeSyncClient::IsPasswordSyncAllowed()
If the value is kOffAndMigrationPending then password sync is not allowed.

At Android UI after switching passwords sync on the refresh happens and SyncPrefs::GetSelectedTypesForSyncingUser is invoked, which excludes passwords from the selected types link

  if (!password_sync_allowed_) {
    selected_types.Remove(UserSelectableType::kPasswords);
  }

and the switch control was turned back into off state.

Resolves brave/brave-browser#36190

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Test plan on Nightly channel

  1. Install fresh https://github.com/brave/brave-browser/releases/tag/v1.67.52, Nightly v1.67.52 (Chromium 124.0.6367.91), Bravearm64Universal.apk
  2. Save any password (I logged in into GMail), ensure it presents at Brave Password Manager
  3. Enable Sync, switch Sync Passwords on
  4. Install install on a top a version https://github.com/brave/brave-browser/releases/tag/v1.75.69 Nightly v1.75.69 (Chromium 132.0.6834.15), Bravearm64Universal.apk
  5. Go to Settings => Sync => Data types
  6. Actual - Passwords switch is disabled by itself
  7. Try to switch passwords on - actual - cannot switch passwords on
  8. Install on a top a version with a fix - v1.75.82 or higher - enable passwords should work

Test plan on Nightly channel

For Release, basically run through the exact same STR/Cases mentioned above but use the following versions:

Once you've reproduced the issue, apply/upgrade to the new 1.73.x with the fix.

…wed_ always true. Fixed issue of unable to switch on the passwords sync on Android;
@AlexeyBarabash AlexeyBarabash added the CI/skip Do not run CI builds (except noplatform) label Dec 5, 2024
@AlexeyBarabash AlexeyBarabash removed the CI/skip Do not run CI builds (except noplatform) label Dec 5, 2024
@AlexeyBarabash AlexeyBarabash changed the title Override SyncPrefs::SetPasswordSyncAllowed to keep password_sync_allo… Fixed issue of unable to switch on the passwords sync on Android Dec 6, 2024
@AlexeyBarabash AlexeyBarabash marked this pull request as ready for review December 6, 2024 14:59
@AlexeyBarabash AlexeyBarabash requested a review from a team as a code owner December 6, 2024 14:59
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change LGTM!

@bsclifton
Copy link
Member

Going to do an admin merge as some of the folks are on PTO and this change can help a lot of folks!

@bsclifton bsclifton merged commit 7aa69a9 into master Dec 6, 2024
18 checks passed
@bsclifton bsclifton deleted the android_sync_passwords_switch branch December 6, 2024 17:57
@github-actions github-actions bot added this to the 1.75.x - Nightly milestone Dec 6, 2024
brave-builds added a commit that referenced this pull request Dec 6, 2024
brave-builds added a commit that referenced this pull request Dec 6, 2024
@Tbrot79
Copy link

Tbrot79 commented Dec 7, 2024

Hi there

this fix has not worked for me - i have updated and now have 1.73.97 and it still does not allow me to toggle the password button -

@bsclifton
Copy link
Member

Hi @Tbrot79 - thanks for checking in. This fix is not released yet. Please stay tuned- we might have a 1.73.x release with this fix in the next week or so. You can watch #26919 and when that code gets merged you'll know we're close to a release. Thanks!

@kjozwiak
Copy link
Member

Verification PASSED on Pixel 6 running Android 15 using the following build(s):

Brave | 1.75.89 Chromium: 132.0.6834.33 (Official Build) canary (64-bit)
--- | ---
Revision | 0bd783db53f8d64c0d6cf4e6068ca17e0cd56cc2
OS | Android 15; Build/AP41.240925.012; 35; REL

Verified that the above fix was working using the STR/Cases outlined via #26876 (comment) as per the following:

screen-20241210-120257.mp4

kjozwiak pushed a commit that referenced this pull request Dec 10, 2024
kjozwiak pushed a commit that referenced this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to sync passwords
4 participants