-
Notifications
You must be signed in to change notification settings - Fork 834
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
Add "--upgrade-from-muon" flag to auto-import from Muon #729
Conversation
@bridiver Might you have feedback on the first two bullet points listed in the top comment? |
@@ -15,3 +16,7 @@ BraveBrowserMainExtraParts::~BraveBrowserMainExtraParts() { | |||
void BraveBrowserMainExtraParts::PreCreateThreads() { | |||
brave::InitializeResourceBundle(); | |||
} | |||
|
|||
void BraveBrowserMainExtraParts::PreMainMessageLoopRun() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine because the profile is initialized in PreMainMessageLoopRun and this will run after the chrome extra parts, but I think we want to guard this with local_state pref that is set after import instead of using a command line flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think guarding with a local_state pref would be preferable to conditioning auto-import on first run, e.g. via first_run::IsChromeFirstRun?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using a command line flag
We need a command line flag to distinguish "Brave-Core is running for the first time after being installed by the Muon upgrader" and "Brave-Core is running for the first time after being downloaded and installed de novo". See brave/brave-browser#1545 (comment) for discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we just upgrade by default if we detect a previous browser-laptop install? Then no command line flag is necessary and a pref would work fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we just upgrade by default if we detect a previous browser-laptop install?
We discussed this in a meeting last week and consensus was that auto-import should only happen in the case where the user is running browser-laptop and performs the update that migrates them to brave-core. We need a way to distinguish this from the case where the user downloads and installs brave-core separately, but may also have an existing browser-laptop installation (which could be their current/default browser, or defunct and unused and therefore probably not desirable to auto-import from). We agreed that passing a command line argument to the brave-core binary from the auto-update was the best way to distinguish these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bridiver What do you think of the local state pref I added in 51c68d4? With this addition,
- auto-import from Muon only occurs if triggered by passing
--upgrade-from-muon
command line flag - auto-import from Muon status is tracked in a local_state pref, so auto-import can occur at most once
- the local_state pref may be useful to other components (e.g. if Brave Rewards wants to convert pins -> donations, it can check the pref to see if there are any imported pins that need conversion)
One issue that I noticed while testing this yesterday: on some platforms (at least macOS and Linux), some of the supported importer data types (cookies and saved passwords) are encrypted by Muon with the "Chromium Safe Storage" key in the system keyring. In order to import these data types, the importer automatically prompts the user to provide their password so it can access the required key from the system keyring. When import from Muon is triggered by a user action, the keychain password prompt is slightly weird (the choice of the "Chromium Safe Storage" key name by Muon is unfortunate, but there's nothing that can be done about that now), but it sort of makes sense and at least there's something of a cause-effect relationship evident to the user. I am concerned that the keychain password prompt will be more confusing, or even alarming, for users when the Muon importer is automatically run during the Muon -> Brave-Core upgrade (as requested in brave/brave-browser#872). In this case, all the user sees is a blank browser window, followed by a keychain password prompt with no additional context. Our options here are:
|
@garrettr Well, that's a bummer! Is there a way for us to provide an additional prompt to the user before showing the unfortunately-named "chromium safe storage" system prompt? Otherwise it will be inexplicable. (I'm not sure what it would say; that's an interesting challenge right there). |
@davidtemkin We can pop a system dialog at that point, but it's hard for me to imagine a good UX. All I can think of is displaying a modal dialog that says "We've detected that you're auto-upgrading from a previous version of Brave browser. To automatically import all of your settings, you will need to Allow the subsequent keychain access prompt" with a single button: Ok/Continue. I despise both modal dialogs and dialogs that don't actually offer the user choices, but can't think of any other options. |
@garrettr @bsclifton wait, I have a different idea... since the actual upgrade process will look like this (as far as I know)
--> Can we "export" the salient data within Muon (do this silently) to an area that can be read without user permission by Brave-Core? |
@garrettr I personally think it makes sense to try the import, even if it shows the prompt. We can address this by showing more details in the banner that comes up when an update is available in browser-laptop (before the restart happens). @bradleyrichter can help me with that messaging |
Thanks for the reviews and feedback, everyone. I'll try to incorporate everything and get a final PR ready for review by Monday. |
89a0263
to
51c68d4
Compare
Can I get another comprehensive review from any of the currently assigned reviewers? Other than a final squash before merge, I think this PR is ready or close to being ready to merge. Re: #729 (comment) and subsequent discussion, if we want to do something about it I think it should be tracked in a follow-up because
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do first_run.h
and first_run.cc
overrides to add AutoImportMuon
so we don't have to copy ImportEndedObserver
and ImportFromSourceProfile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
9ff9a7b
to
b151293
Compare
Add "--upgrade-from-muon" flag to auto-import from Muon
Add "--upgrade-from-muon" flag to auto-import from Muon
I'm looking for feedback on this WIP PR for brave/brave-browser#1545, specifically:
BraveBrowserMainExtraParts::PreMainMessageLoopRun
as hook point appropriate, or is there perhaps a better location?first_run::AutoImport
, mostly boilerplate for setting up the importer and handling callbacks. Is this ok, or would it be preferable for me to switch to an approach that patchesfirst_run::AutoImport
to minimize duplicated code, as I proposed in comments starting with Allow auto-upgrade from browser-laptop via argument brave-browser#1545 (comment))?Any other feedback or suggestions very welcome! Feel free to untag/tag in other reviewers if necessary.