Closed Bug 1691135 Opened 4 years ago Closed 4 years ago

[Fission] Reload button not working

Categories

(Firefox :: Session Restore, defect, P2)

defect

Tracking

()

RESOLVED FIXED
88 Branch
Fission Milestone M7
Tracking Status
firefox88 --- fixed

People

(Reporter: neha, Assigned: pbone)

References

(Blocks 1 open bug)

Details

(Whiteboard: [3/11]: patches in review)

Attachments

(2 files, 2 obsolete files)

Running with Fission, and somehow one of my bugzilla tabs has resulted in a bad state where the reload button is not doing anything at all. Other bugzilla tabs are able to reload fine.

Browser console shows:
TypeError: can't access property "requestSHistoryUpdate", this.browser.frameLoader is null
SessionStore.jsm:1019:11
notifySHistoryChanges resource:///modules/sessionstore/SessionStore.jsm:1019
OnHistoryReload resource:///modules/sessionstore/SessionStore.jsm:1057

Severity: -- → S2
Fission Milestone: --- → M7
Priority: -- → P2

Nika figured out the STR for this:
With Fission enabled, drag out a working tab out to a new window. The reload on this page now stops working with the error reported in the bug description.

Peter and Nika can reproduce this error.

  1. NOTIFY_LISTENERS_CANCELABLE should check an nsresult and not cancel reload if reload listener fails: https://searchfox.org/mozilla-central/rev/c8ce16e4299a3afd560320d8d094556f2b5504cd/docshell/shistory/nsSHistory.cpp#135-136
  2. Store browserId instead of browser reference on history listener? Expose GetCurrentTopByBrowserId() to JS through IDL.
Assignee: nobody → pbone
Status: NEW → ASSIGNED

Hi Nika or Peter.

I have written a test for this but it only works (sucesfully reproduces the bug) if it sleeps after moving the tab but before clicking reload. There's something that happens in between that causes this bug to happen, and that my test should wait on instead. Do you have some ideas of what it could be?

Thanks.

Flags: needinfo?(peterv)
Flags: needinfo?(nika)

I'm not 100% sure what's happening here, but perhaps you could do something like:

// After adding tab1, and before swapping...
let prevBrowser = tab1.linkedBrowser;

// ... later, when you're needing to add the sleep:
ok(!prevBrowser.frameLoader, "the swapped-from browser's frameloader has been destroyed");

If that check is failing, it means you're probably not waiting long enough for the browser in the swapped-from tab to become fully destroyed.

Flags: needinfo?(nika)
Flags: needinfo?(peterv)

(In reply to Nika Layzell [:nika] (ni? for response) from comment #5)

// ... later, when you're needing to add the sleep:
ok(!prevBrowser.frameLoader, "the swapped-from browser's frameloader has been destroyed");

If that check is failing, it means you're probably not waiting long enough for the browser in the swapped-from tab to become fully destroyed.

The check passes, so that's not it.

I'd like to check some things.

(In reply to Chris Peterson [:cpeterson] from comment #2)

Peter and Nika can reproduce this error.

  1. NOTIFY_LISTENERS_CANCELABLE should check an nsresult and not cancel reload if reload listener fails: https://searchfox.org/mozilla-central/rev/c8ce16e4299a3afd560320d8d094556f2b5504cd/docshell/shistory/nsSHistory.cpp#135-136

This code should use the nsresult to determine if the JavaScript in the listener threw an exception or exited normally. It should only cancel the reload if it exited normally returning false.

  1. Store browserId instead of browser reference on history listener? Expose GetCurrentTopByBrowserId() to JS through IDL.

Is the problem that the browser is replaced when the tab is dragged to a new window? And the browser ID remains the same?

The browser's frameLoader property is null. Is the browser dying? why is its listener still alive?

It looks like I can find the browser id from the browser's browsing context when the listener is created. To turn that into a new browsing context (which I guess is suitable). Nika/Peter suggested using GetCurrentTopByBrowserId() That's a static method on BrowsingContext. How do you export a static method to JS through IDL? I see only non-static methods exported in this way, do I need to make a Service?

(In reply to Paul Bone [:pbone] from comment #7)

I'd like to check some things.

Nika replied via Matrix and I have answers to all of this now.

Attachment #9206204 - Attachment description: Bug 1691135 - Add a test → Bug 1691135 - SHistoryListeners track browser ID is it is constant r=nika

This macro was used in two places to do the same thing. We can remove this
over-generalisation and have clearer code.

Depends on D107803

Attached file Bug 1691135 - Remove the NOTIFY_LISTENERS macro (obsolete) (deleted) —

We can replace this macro with a static function to make the code here
easier to read.

Depends on D107804

Attachment #9206204 - Attachment description: Bug 1691135 - SHistoryListeners track browser ID is it is constant r=nika → Bug 1691135 - pt 1. SHistoryListeners track browser ID as it is constant r=nika
Attachment #9208046 - Attachment description: Bug 1691135 - Don't cancel a reload if the listener crashed r=nika → Bug 1691135 - pt 2. Don't cancel a reload if the listener crashed r=nika

Comment on attachment 9208047 [details]
Bug 1691135 - Remove NOTIFY_LISTENERS_CANCELABLE r=mccr8

Revision D107804 was moved to bug 1697737. Setting attachment 9208047 [details] to obsolete.

Attachment #9208047 - Attachment is obsolete: true

Comment on attachment 9208048 [details]
Bug 1691135 - Remove the NOTIFY_LISTENERS macro

Revision D107805 was moved to bug 1697737. Setting attachment 9208048 [details] to obsolete.

Attachment #9208048 - Attachment is obsolete: true
Whiteboard: [3/11]: patches in review
Attachment #9208046 - Attachment description: Bug 1691135 - pt 2. Don't cancel a reload if the listener crashed r=nika → Bug 1691135 - pt 2. Don't cancel a reload if the listener threw an exception r=nika
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2eb1179e274f pt 1. SHistoryListeners track browser ID as it is constant r=nika https://hg.mozilla.org/integration/autoland/rev/c11964b044fb pt 2. Don't cancel a reload if the listener threw an exception r=nika
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: