Closed Bug 1576085 Opened 4 months ago Closed 4 months ago

Multiple concurrent top-level await expression returning the same result are coalesced in a single result message

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox70 fixed)

RESOLVED FIXED
Firefox 70
Tracking Status
firefox70 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(1 file)

Steps to reproduce

  1. Open the console
  2. Switch to editor mode as it's easier to request the same evaluation multiple times quickly
  3. paste the following in the input:
await new Promise(res => setTimeout(() => res("plouk"), 5000))
  1. Hit Ctrl+Enter (or Cmd+Enter on OSX) quickly 3 times

Expected results

After ~5s, 1 get 3 result messages with plouk

Actual results

I only get 1 result message with plouk


For what it's worth, there is no issue with the promise resolves with something different each time, e.g.:

await new Promise(res => setTimeout(() => res(Date.now()), 5000))

This is because we allow evaluation results to be repeated (it's more something we didn't think about since prior to top-level await, you couldn't have 2 evaluations results next to each other).

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

With top-level await, we can now have multiple
evaluation results next to each others. Which
means that if they had the same repeatId, we
would only print the first result.
We fix that by not allowing evaluation results to
be repeated.
A mochitest is added to ensure the patch properly
fixes the issue.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8098c67fb538
Don't allow evaluation results to be repeated. r=Honza.
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
You need to log in before you can comment on or make changes to this bug.