Closed Bug 1786805 Opened 3 years ago Closed 3 years ago

Instant evaluation allows side-effects after` await`

Categories

(DevTools :: Console, defect, P2)

Firefox 104
defect

Tracking

(firefox105 verified, firefox106 verified)

VERIFIED FIXED
106 Branch
Tracking Status
firefox105 --- verified
firefox106 --- verified

People

(Reporter: cpplearner, Assigned: nchevobbe)

Details

Attachments

(1 file)

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

Steps to reproduce:

  1. Open the Web Console
  2. Type await 1; alert("bug") (without the backticks), but don't hit the enter key

Actual results:

A dialog is displayed.

Expected results:

Nothing, as if the expression is not evaluated.

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

Component: Untriaged → Console
Product: Firefox → DevTools

Thanks for reporting the issue. I can reproduce it easily

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

104 is impacted.
To begin with, we can simply disable instant-evaluation for top-level await expression, and ask to uplift the patch to 105 to quickly fix the issue.
We may have a follow-up bug to re-enable it, while fixing this specific issue

Flags: needinfo?(nchevobbe)
Version: Firefox 105 → Firefox 104
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/676ab9a6746e [devtools] Disable instant evaluation for top-level await expressions. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch

Comment on attachment 9291716 [details]
Bug 1786805 - [devtools] Disable instant evaluation for top-level await expressions. r=jdescottes.

Beta/Release Uplift Approval Request

  • User impact if declined: expressions with side effects (e.g. , calling alert, assigning a variable, changing the dom, …) might be evaluated as the user types in the console input, which could be annoying at best, or plainly confusing
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: 1. Open the console
  1. Type await 1; alert("booh") (without hitting Enter)

-> there should be no alert dialog displayed

  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): small DevTools-only patch, simply gating a call to a function
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9291716 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

I have reproduced this issue using Firefox 106.0a1 (2022.08.24) and on Firefox 105.0b4 on Win 10 x64.
I can confirm this issue is fixed, I verified using Firefox 106.0a1 (2022.08.28) on Win 10 x64, macOS 10.15 and Ubuntu 22.04 x64.

Comment on attachment 9291716 [details]
Bug 1786805 - [devtools] Disable instant evaluation for top-level await expressions. r=jdescottes.

Approved for 105.0b5. Do we want to nominate this for dot release uplift as well?

Attachment #9291716 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I can confirm this issue is fixed, I verified using Firefox 105.0b5 on Win 10 x64, macOS 10.15 and Ubuntu 22.04 x64.

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

Attachment

General

Created:
Updated:
Size: