Closed Bug 2083975 Opened 26 days ago Closed 12 days ago

Notification bar created by RelaunchRequired enterprise policy is not replicated to Firefox windows created subsequently

Categories

(Firefox :: Messaging System, defect, P1)

Firefox 159
defect

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- fixed
firefox159 --- wontfix
firefox160 --- wontfix
firefox161 --- fixed

People

(Reporter: bugzilla, Assigned: mkaply)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 external files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:159.0) Gecko/20100101 Firefox/159.0

Steps to reproduce

  1. Implemented the new RelaunchRequired enterprise policy
  2. The 159b4 update was automatically applied in the background
  3. Waited until the notification bar spawned due to the policy was shown: "A new version of Firefox is available. Your administrator will restart your browser at…"
  4. Ignored the prompt to Update now and instead created a new window using File > New Window

Actual results

The notification bar is not shown on the new window.

Expected results

The notification bar should be shown on the new window so that the user continues to be prompted to Update now

Component: Untriaged → Enterprise Policies
See Also: → 2085960
Duplicate of this bug: 2085960

This isn't specific to RelaunchRequired: no universal infobar shows up in a window opened after the bar first appears.

When a new window opens, InfoBar gets a domwindowopened notification and calls _showWhenLoaded. That function shows the bar right away if the window's readyState is "complete", and otherwise waits for load. At domwindowopened the window still has its initial about:blank document, which already reports "complete". So _showWhenLoaded doesn't wait: it finds no tabbrowser yet and gives up without showing anything.

The other caller, showNotificationAllWindows, only calls _showWhenLoaded for windows that are still loading. So neither caller can reach the "show right away" branch with a window that is actually ready. Only tests reached it, by passing windows that were already loaded or faked as complete, which is why this wasn't caught.

The fix removes that branch so _showWhenLoaded always waits for load. It updates those two tests and adds a test that opens a real window and checks that the bar appears in it.

Component: Enterprise Policies → Messaging System
Assignee: nobody → mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

This also affects the Terms of Use infobar. The tou-experience-0 rollouts (US and non-US) ship tou-experience-0-white-infobar and tou-experience-0-blue-infobar as universal infobars, so they never appear in windows opened after the bar first shows. I confirmed it locally with the real tou-experience-0-white-infobar message: without this patch it shows in the original window but not in a new one; with the patch it shows in both.

Universal infobars have missed new windows since they were introduced in bug 1960078. At domwindowopened the window still has its initial about:blank document, which already reports readyState "complete", so the show-immediately branch ran before the browser document loaded. Originally that threw; later it returned silently.

thanks for catching this and for the fix. One small correction, Universal infobars did trigger in new windows, running mozregression it looks like it's been broken since 147:

 6:41.38 INFO: Last good revision: 37f1c536fdb89cd69039774a87f3ad8a94b95328
 6:41.38 INFO: First bad revision: 86c4f03a43058ea62f76021ad5a50e6199c34567
 6:41.38 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=37f1c536fdb89cd69039774a87f3ad8a94b95328&tochange=86c4f03a43058ea62f76021ad5a50e6199c34567

however, the "regressor" highlighted that the infobar code wasn't right about what complete meant

Type: enhancement → defect
Keywords: regression
Regressed by: sync-about-blank
Priority: -- → P1

Set release status flags based on info from the regressing bug 543435

Pushed by mozilla@kaply.com: https://github.com/mozilla-firefox/firefox/commit/6850376f392e https://hg.mozilla.org/integration/autoland/rev/81010ada3e05 Wait for load before showing a universal infobar in a new window. r=omc-reviewers,mimi
Status: ASSIGNED → RESOLVED
Closed: 12 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch

The patch landed in nightly and ESR is affected.

:mkaply, please make an uplift decision for ESR:

  • For ESR, nominate the patch for the appropriate ESR uplift approval if the fix should be included in ESR, or set the ESR status flag(s) to wontfix if an uplift isn't needed. Each affected ESR release needs a decision.

Uplift requests can be submitted from Lando: D336938.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)

firefox-esr153 Uplift Approval Request

  • User impact if declined/Reason for urgency: Infobar for TOS and forced update doesn't show in all windows.

Regression

  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Actually makes the code more reliable
  • String changes made/needed?: None
  • Is Android affected?: no
Attachment #9674178 - Flags: approval-mozilla-esr153?
Flags: needinfo?(mozilla)
Attachment #9674178 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: