Relaunch issues on Mac
See original GitHub issueDescription
There’s an issue I saw several times on Mac with browser relaunch. If an update is available, and relaunch is triggered from a non-update-related flow, weird stuff is happening.
Steps to Reproduce
It’s tricky to reproduce because you need to have a browser with a pending update. I’m not sure that the steps are precise but I believe it’s something similar.
- Launch Brave on Mac and wait for an update to be available and pending.
- Go to chrome://flags.
- Change a flag, you’ll see a button to relaunch the browser.
- Click the button to relaunch the browser.
Actual result:
Things break. One time the browser crashed. Other time it launched but was just a blank window, without tabs or URL bar or anything at all.
Expected result:
Proper relaunch.
Reproduces how often:
Intermittent issue.
Brave version (brave://version info)
Latest Mac and latest Brave.
Version/Channel Information:
Didn’t try but pretty sure it’s not channel-specific.
Other Additional Information:
I’m pretty sure it’s related to these changes:
I tried to contribute a fix but gave up. What I figured is that there are two ways to relaunch a browser: with Chromium functions and with code from Sparkle. The Chromium functions only work when no update is pending, and the Sparkle function only works when an update is pending. But Brave doesn’t check whether an update is pending. Instead, it tries to guess, e.g. if you’re on chrome://flag, chances are no update is pending. This assumption can often be incorrect.
What I tried to do is changing Sparkle’s relaunch function to handle the case of no pending update and just return false instead of throwing an assert. Then, this code can be used in Brave (pseudo code):
bool relaunched = [sparkle_glue relaunch];
if (!relaunched) {
chrome::relaunch();
}
But as I said, changing Sparkle and the Objective C code was too much for me.
- Does the issue resolve itself when disabling Brave Shields? Unrelated
- Does the issue resolve itself when disabling Brave Rewards? Unrelated
- Is the issue reproducible on the latest version of Chrome? No, Chrome doesn’t use Sparkle on Mac
Miscellaneous Information:
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Yes, correct. @rebron I think this could happen more frequently as we are adding more
Relaunch
buttons in settings. I’m on this now.Maybe related to https://github.com/brave/brave-browser/issues/11055? cc @rebron