Skip to content
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

Fixed first-run dialog is not launched #9849

Merged
merged 2 commits into from
Aug 25, 2021
Merged

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Aug 25, 2021

fix brave/brave-browser#17667

With https://bugs.chromium.org/p/chromium/issues/detail?id=1243221,
Local State file is created at the startup.
When, "Local State" file is already existed ShouldShowFirstRunDialog().
Due to this, dialog is launched ramdomly only when this file is not
stored in FS becfore calling ShouldShowFirstRunDialog().
Browser only tries to run this dialog when first_run::IsChromeFirstRun()
is true. Checking "Local State" file again is redundant. Removed this
checking.

Resolves

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • 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, npm run lint, 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:

`npm run test brave_unit_tests -- --filter=BravePathsTest

  1. Laucnh browser with clean profile
  2. Check First run dialog is always launched

@simonhong simonhong requested a review from a team as a code owner August 25, 2021 09:42
@simonhong simonhong self-assigned this Aug 25, 2021
browser/sources.gni Outdated Show resolved Hide resolved
fix brave/brave-browser#17667

With https://bugs.chromium.org/p/chromium/issues/detail?id=1243221,
Local State file is created at the startup.
When, "Local State" file is already existed ShouldShowFirstRunDialog().
Due to this, dialog is launched ramdomly only when this file is not
stored in FS becfore calling ShouldShowFirstRunDialog().
Browser only tries to run this dialog when first_run::IsChromeFirstRun()
is true. Checking "Local State" file again is redundant. Removed this
checking.
browser/sources.gni Outdated Show resolved Hide resolved
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

brave_chromium_src_chrome_browser_first_run_deps = [ "//brave/common" ]
Copy link
Member Author

Choose a reason for hiding this comment

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

this file is deleted.

// Use for getting false from base::PathService::Get().
namespace chrome {

enum { CHROME_PATH_INVALID = 20000 };
Copy link
Member Author

Choose a reason for hiding this comment

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

deleted.

@simonhong simonhong requested a review from goodov August 25, 2021 10:55
@simonhong
Copy link
Member Author

Merged because org.chromium.chrome.browser.BytecodeTest#testFieldsExist failure from android CI is not related with this PR. Filed brave/brave-browser#17690

@simonhong simonhong merged commit 0b78f9e into master Aug 25, 2021
@simonhong simonhong deleted the cr93_first_run_regression branch August 25, 2021 14:13
@simonhong simonhong added this to the 1.30.x - Nightly milestone Aug 25, 2021
mkarolin pushed a commit that referenced this pull request Aug 25, 2021
Fixed first-run dialog is not launched
mkarolin added a commit that referenced this pull request Sep 9, 2021
This reverts commit 0b78f9e, reversing
changes made to d260b6a.

Reverting because upstream has fixed the first run regression via:

https://chromium.googlesource.com/chromium/src.git/+/f9385e0d893916cbb16b477bdec127e56f9897da

Cherry-picked into cr94 as
https://chromium.googlesource.com/chromium/src/+/3f20e2edeb0adf78a6a9a6208e2e02ad3c7d8810

commit f9385e0d893916cbb16b477bdec127e56f9897da
Author: Caitlin Fischer <caitlinfischer@google.com>
Date:   Mon Aug 30 13:31:02 2021 +0000

    Ignore Local State when deciding whether to show the first run dialog.

    The bug was caused by an experiment that causes Local State to be
    written to disk during startup (before the first-run-dialog-showing
    logic is reached) on some clients. Since Local State existed on some
    clients, the dialog was not shown. However, the first-run-dialog-showing
    logic should not depend on the presence or absence of a Local State
    file.

    This change affects some POSIX platforms running Google Chrome for the
    first time. This logic being removed was originally added here:
    https://chromiumcodereview.appspot.com/14946003/.

    Bug: 1221483
mkarolin added a commit that referenced this pull request Sep 11, 2021
This reverts commit 0b78f9e, reversing
changes made to d260b6a.

Reverting because upstream has fixed the first run regression via:

https://chromium.googlesource.com/chromium/src.git/+/f9385e0d893916cbb16b477bdec127e56f9897da

Cherry-picked into cr94 as
https://chromium.googlesource.com/chromium/src/+/3f20e2edeb0adf78a6a9a6208e2e02ad3c7d8810

commit f9385e0d893916cbb16b477bdec127e56f9897da
Author: Caitlin Fischer <caitlinfischer@google.com>
Date:   Mon Aug 30 13:31:02 2021 +0000

    Ignore Local State when deciding whether to show the first run dialog.

    The bug was caused by an experiment that causes Local State to be
    written to disk during startup (before the first-run-dialog-showing
    logic is reached) on some clients. Since Local State existed on some
    clients, the dialog was not shown. However, the first-run-dialog-showing
    logic should not depend on the presence or absence of a Local State
    file.

    This change affects some POSIX platforms running Google Chrome for the
    first time. This logic being removed was originally added here:
    https://chromiumcodereview.appspot.com/14946003/.

    Bug: 1221483
mkarolin added a commit that referenced this pull request Sep 13, 2021
This reverts commit 0b78f9e, reversing
changes made to d260b6a.

Reverting because upstream has fixed the first run regression via:

https://chromium.googlesource.com/chromium/src.git/+/f9385e0d893916cbb16b477bdec127e56f9897da

Cherry-picked into cr94 as
https://chromium.googlesource.com/chromium/src/+/3f20e2edeb0adf78a6a9a6208e2e02ad3c7d8810

commit f9385e0d893916cbb16b477bdec127e56f9897da
Author: Caitlin Fischer <caitlinfischer@google.com>
Date:   Mon Aug 30 13:31:02 2021 +0000

    Ignore Local State when deciding whether to show the first run dialog.

    The bug was caused by an experiment that causes Local State to be
    written to disk during startup (before the first-run-dialog-showing
    logic is reached) on some clients. Since Local State existed on some
    clients, the dialog was not shown. However, the first-run-dialog-showing
    logic should not depend on the presence or absence of a Local State
    file.

    This change affects some POSIX platforms running Google Chrome for the
    first time. This logic being removed was originally added here:
    https://chromiumcodereview.appspot.com/14946003/.

    Bug: 1221483
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.

default browser dialog (first run dialog) doesn't show on Chromium 93 versions of Nightly
2 participants