question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relaunch issues on Mac

See original GitHub issue

Description

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.

  1. Launch Brave on Mac and wait for an update to be available and pending.
  2. Go to chrome://flags.
  3. Change a flag, you’ll see a button to relaunch the browser.
  4. 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:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
simonhongcommented, Sep 28, 2022

Maybe related to #11055? cc @rebron

Yes, correct. @rebron I think this could happen more frequently as we are adding more Relaunch buttons in settings. I’m on this now.

0reactions
LaurenWagscommented, Sep 27, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

If your Mac restarted because of a problem - Apple Support
Unexpected restarts are usually caused by software installed on your Mac, or by devices connected to your Mac. If the issue causes your...
Read more >
What to do when your Mac keeps restarting? - CleanMyMac X
The most common cause of a Mac continually restarting is called “kernel panic.” This occurs when your Mac's kernel, or operating system, detects...
Read more >
Your Apple MacBook Keeps Restarting. Here's What's Going ...
5 reasons your MacBook keeps restarting and how to fix the issue · MacOS isn't updated · Your software is causing an error...
Read more >
MacBook Pro Keeps Restarting? Address the Reboot Loop Here
Part 1. Why MacBook Pro Keeps Restarting? · The most common issue is conflicting applications. · Another issue could be incompatible hardware or...
Read more >
MacBook Pro Keeps Restarting? 8 Ways to Fix It
Part 2: How to Fix MacBook Pro Keeps Restarting? · Tip 1: Check the peripheral devices connected to your Mac · Tip 2:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found