Prevent the "Update available" Sparkle popup on Mac #12335
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It was shown when Brave was run as non-admin user and tried to update a system-wide installation.
Resolves brave/brave-browser#9562
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
This PR has the potential to brick Brave's update fleet on macOS. It is therefore very important to test it thoroughly.
Affected functionality
This PR affects the following functionality:
brave://settings/help
.Especially the first one 1. should be tested carefully. If this breaks, then Brave's entire macOS fleet will no longer receive updates and users would have to update manually.
Scenarios to test
At least the following scenarios should be tested, with the most important ones listed first:
Here's how to test them:
"1.": Ideally, there is already a newer release of Brave. So say you have v1.2.3 (which includes the changes from this PR) and there is 1.2.4 on github.com/brave/brave-browser/releases. Then you would install v1.2.3 into /Applications. Start Brave once. Make sure brave://settings/help is not open. (Otherwise, that page would trigger an on-demand update check now or on the next launch of Brave). Close Brave. Wait for 3 hours. (Maybe it also works to change the system time.) Start Brave again and wait for a few minutes. Close Brave. Open brave://settings/help. It should now say it's at version 1.2.4. There should not have been any "Update available" popup as shown in the screenshots in brave/brave-browser#9562.
If the above does not work, then you can inspect the logs by launching Brave with the following command in a terminal:
The following command in a terminal should also show some interesting output if an update gets applied:
"2.": Install Brave "1.2.3" (see "1." above) into /Applications and (as a user with admin rights) open brave://settings/help. An update should be applied but no update popup should be visible. Relaunch Brave and check that brave://settings/help shows the new version. There should not have been any "Update available" popup as shown in the screenshots in brave/brave-browser#9562.
"3.a)": Repeat "2." but execute Brave as a non-admin user. The update should be applied. Relaunch Brave. This should open a dialog asking you to grant admin permissions for the update modifications. Grant admin permissions. The new version of Brave should launch.
brave://settings/help
should show the new version. There should not have been any "Update available" popup as shown in the screenshots in brave/brave-browser#9562."3.b)": Repeat "3.a)" but do not grant admin permissions after relaunching Brave. This will likely prevent Brave from opening on the first time. But when you open Brave again, it should work successfully and
brave://settings/help
should show the old version."4.": Repeat "1." but execute Brave as a non-admin user. No update should be applied. Be careful not to open
brave://settings/help
, because that would apply an update. There should also not be an "update available" popup.