Closed Bug 1867483 Opened 1 year ago Closed 10 months ago

Responsive design mode shortcut freezes upon repeated use

Categories

(DevTools :: Responsive Design Mode, defect, P2)

Firefox 120
x86
Windows 10
defect

Tracking

(firefox123 verified)

VERIFIED FIXED
123 Branch
Tracking Status
firefox123 --- verified

People

(Reporter: kjti0x6145e, Assigned: ochameau)

References

Details

Attachments

(1 file)

Steps to reproduce:

  • Go to any website
  • Repeatedly press ctrl+shift+m in quick succession
    (Alternatively, just hold down m while holding ctrl+shift, as that sends a lot of m keystrokes quite quickly)

Actual results:

The tab got stuck in responsive design mode and both the x button which should return it back to normal and the shortcut ctrl+shift+m stopped working for that tab

Expected results:

It should have continued switching between responsive design and normal mode, or if that is not possible, at least inform me of that

OS: Unspecified → Windows 10
Hardware: Unspecified → x86

The Bugbug bot thinks this bug should belong to the 'DevTools::Responsive Design Mode' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Responsive Design Mode
Product: Firefox → DevTools

Reproduced on windows, :ochameau will add a stacktrace

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(poirot.alex)
Priority: -- → P2

Reproduced on Windows and got the following exception:

TypeError: can't access property "isDestroyed", this.responsiveFront is undefined
    destroy resource://devtools/client/responsive/ui.js:269
    closeIfNeeded resource://devtools/client/responsive/manager.js:195
    _toggleForTab resource://devtools/client/responsive/manager.js:102
    toggle resource://devtools/client/responsive/manager.js:95
    onKeyShortcut resource://devtools/client/framework/devtools-browser.js:298
    onKey resource:///modules/DevToolsStartup.sys.mjs:890
    xulKey resource:///modules/DevToolsStartup.sys.mjs:808
Flags: needinfo?(poirot.alex)
Duplicate of this bug: 1872795

Let me try to have a look as I'm able to reproduce.

Assignee: nobody → poirot.alex

Unmounting the top level React component will help avoid trigerring React updates
when async thunk actions keep dispatching new actions after the tool is closed.
This was leading to various exceptions in many React components.

Also avoid a race condition where responsiveFront could be undefined when closing
RDM while it is still initializing.

Finally, ensure registering the ResponsiveUI immediately in activeTabs to prevent
race condition in openIfNeeded.

Adding some test coverage for such race condition, but can't enable this on verify.
In chaos mode, there is too many exceptions at the test teardown.
Ideally, RDM should:

  • only close the RDP client and let the server restore the default value on its own.
    i.e. we shouldn't do any request on closing.
  • RDM close requests should wait for previous initialization request to be done.
    This would avoid zillion of possible exceptions because initialization is very async
    and each step may throw because of things are already being destroyed.
    But this wouldn't address race condition when the tab is closed.
    So RDM should probably try to have a more resilient initialization sequence as well.

Can you check if the patch is ready for review?

Flags: needinfo?(poirot.alex)
Duplicate of this bug: 1873314

I'm struggling with the mochitest, still failing on debug builds.

Flags: needinfo?(poirot.alex)
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e8522cd39ca8 [devtools] Stop async redux/react code after RDM is closed. r=devtools-reviewers,nchevobbe
Regressions: 1874227
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
QA Whiteboard: [qa-123b-p2]

Reproduced this issue on an affected Nightly build from 2023-11-30, on Win 10.
Verified as fixed on Firefox 123.0b2 (20240124102023) across the following platforms: Win 10, Win 11, Ubuntu 22 and macOS 10.15. The tab does not get stuck anymore in responsive design mode when using Ctrl+Shift+M (or Cmd+Opt+M on Mac) in quick succession.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-123b-p2]

Hi, I'd just like to thank all of you for fixing the problem this fast. I expected this bug to sit in limbo for half a year at the very least. Thank you and great job! :D

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: