console input is eager evaluated twice on each key stroke
Categories
(DevTools :: Console, defect, P2)
Tracking
(firefox74 verified)
Tracking | Status | |
---|---|---|
firefox74 | --- | verified |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
Steps to reproduce
- Make sure the eager evaluation pref is set to true
- Open the console
- Type
Math.random()
- Wait for a result to be shown
- Type an additional space so the input gets eagerly evaluated again
Expected results
The result is updated once
Actual results
The result is updated twice. It's very visible with Math.random
as we're getting different results.
Assignee | ||
Comment 1•4 years ago
|
||
Before trying to reach the server, we check that the new
expression is different from the previous one.
If it's similar, we bail.
Updated•4 years ago
|
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/23688b6ac3de Don't trigger eager evaluation if the input was the same than for previous evaluation. r=bhackett.
Comment 3•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 4•4 years ago
|
||
I reproduced the initial issue on Nightly 74.0a1 (20200109094415).
I can confirm the issue is no longer reproducible when following the steps from the Description (verified on Ubuntu 18.04, Mac OS X 10.15 and Windows 10 x64 using the latest Firefox 74 beta 3 and the latest Nightly 75.0a1), but I came across 2 situations where the results are still updated several times:
-1. if space is added between the parenthesis, the number is updated with each made space
-2. after pressing enter, the number is updated.
Please see the video for more details.
Nicolas, are these results, expected?
Comment 5•4 years ago
|
||
Sorry for that, added the video again since the previous format is not supported.
Assignee | ||
Comment 6•4 years ago
|
||
Hello Simona,
For 1. , that would be hard to not re-evaluate. We are already trimming the input and checking it's not the same as the previous one. But when the whitespace characters are not at the start and/or beginning of the input, that's more tricky to do
For 2. , yes, this is "expected". The eager evaluation is done at t
time. If you evaluate (i.e., press Enter) at t + X
time, the expression might not be the same (and we do want that, you can think of new Date()
as a good example).
Comment 7•4 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #6)
Hello Simona,
For 1. , that would be hard to not re-evaluate. We are already trimming the input and checking it's not the same as the previous one. But when the whitespace characters are not at the start and/or beginning of the input, that's more tricky to do
Nicolas, should I log a new defect for issue 1?
Assignee | ||
Comment 8•4 years ago
|
||
(In reply to Simona Badau from comment #7)
Nicolas, should I log a new defect for issue 1?
No, I think that's fine.
The work (and perf impact) it would take to not have this would outweigh the benefits.
Comment 9•4 years ago
|
||
Description
•