Closed Bug 1666850 Opened 4 years ago Closed 4 years ago

Add additional checks when using ExperimentStore during early startup

Categories

(Firefox :: Nimbus Desktop Client, defect, P1)

defect

Tracking

()

VERIFIED FIXED
83 Branch
Iteration:
83.1 - Sept 21 - Oct 4
Tracking Status
firefox82 - verified
firefox83 --- verified

People

(Reporter: andreio, Assigned: andreio)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Using the ExperimentAPI in the AboutWelcomeChild uncovered some issues for the early startup scenario of the store. We try to access too early and (I suspect) the lazy getter "saves" this bad store state (undefined) for future access as well.

The problematic calling code is here and commenting out the early access from https://searchfox.org/mozilla-central/rev/3d53187b90605ccef321c9cadbba762ad06a6381/browser/actors/AboutNewTabChild.jsm#42

seems to avoid the undefined store issue that persists to the login usage introduced in https://phabricator.services.mozilla.com/D90988

Not sure if this AboutNewTabChild code introduced in bug 1659152 should be changed or it's somewhat expected that the API can fail thus try/catch used elsewhere, so the fix here is to make sure ExperimentAPI doesn't persist failure to future access.

Depends on: 1659152
Pushed by elee@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9e85d76a5d84
Add additional checks when using ExperimentStore during early startup r=pdahiya
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Blocks: 1666373

[Tracking Requested - why for this release]: Experiment behavior targeting 82 might not load correctly on first run

QA steps:

  1. create a new profile
  2. open firefox (nightly opens about:home and beta opens about:welcome)
  3. open browser console

expect no error message looking like this for about:home

can't convert null to object SharedDataMap.jsm:122
    _notifyUpdate resource://messaging-system/lib/SharedDataMap.jsm:122
    _syncFromParent resource://messaging-system/lib/SharedDataMap.jsm:137
    SharedDataMap resource://messaging-system/lib/SharedDataMap.jsm:52
    ExperimentStore resource://messaging-system/experiments/ExperimentStore.jsm:22
    <anonymous> resource://messaging-system/experiments/ExperimentAPI.jsm:164
    get resource://gre/modules/XPCOMUtils.jsm:58
    isFeatureEnabled resource://messaging-system/experiments/ExperimentAPI.jsm:64
    handleEvent resource:///actors/AboutNewTabChild.jsm:42

or about:welcome

can't convert null to object SharedDataMap.jsm:122
    _notifyUpdate resource://messaging-system/lib/SharedDataMap.jsm:122
    _syncFromParent resource://messaging-system/lib/SharedDataMap.jsm:137
    SharedDataMap resource://messaging-system/lib/SharedDataMap.jsm:52
    ExperimentStore resource://messaging-system/experiments/ExperimentStore.jsm:21
    <anonymous> resource://messaging-system/experiments/ExperimentAPI.jsm:143
    get resource://gre/modules/XPCOMUtils.jsm:58
    getExperiment resource://messaging-system/experiments/ExperimentAPI.jsm:46
    AWGetStartupData resource:///actors/AboutWelcomeChild.jsm:234
Blocks: 1656622
Iteration: --- → 83.1 - Sept 21 - Oct 4
Flags: needinfo?(cmuresan)
Severity: -- → S2
Priority: -- → P1

I have successfully reproduced the issue on the latest Firefox Beta 82.0b3 (BuildID 20200924145114) and have verified that it is no longer reproducible on both the about:welcome and about:home pages on the latest Nightly 83.0a1 (BuildID 20200924215348) using Windows 10 x64, macOS 10.15, and Linux MX 4.19.

Status: RESOLVED → VERIFIED
Flags: needinfo?(cmuresan)

The patch landed in nightly and beta is affected.
:andreio, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(andrei.br92)

Comment on attachment 9177448 [details]
Bug 1666850 - Add additional checks when using ExperimentStore during early startup

Beta/Release Uplift Approval Request

  • User impact if declined: Experiments for new profiles might not run correctly
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Comment 5
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Code adds some checks to use default empty value to avoid accessing null
  • String changes made/needed: None
Attachment #9177448 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Comment on attachment 9177448 [details]
Bug 1666850 - Add additional checks when using ExperimentStore during early startup

approved for 82.0b6

Attachment #9177448 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: needinfo?(andrei.br92)

I have verified that the issue is no longer reproducible on the about:welcome or about:home pages on the latest Firefox Beta 82.0b6 (BuildID 20201001171107) using Windows 10, macOS 10.15, and Linux MX 4.19.

Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: