Web workers lose messages

Fixed Issue #9545866

Details

Created
Oct 26, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
38.14393
Reports
Reported by 3 people

Sign in to watch or report this issue.

Steps to reproduce

Microsoft Edge 38.14393.0.0.
Microsoft EdgeHTML 14.14393

Load the following test case:

<script id="worker" type="worker">
    console.log('worker created', self);

    self.addEventListener('message', function(e) {
        console.log('worker received message', e.data);
    }, false);

    // Comment out the following line to see expected behavior:
    var xhr = new XMLHttpRequest();
</script>
<script>
    var src = document.getElementById('worker').textContent;
    var blob = new Blob([src], { type: 'text/javascript' });
    var workerURL = URL.createObjectURL(blob);
    var worker = new Worker(workerURL);
    setTimeout(function () {
        console.log('posting messages to worker');
        worker.postMessage(1);
        worker.postMessage(2);
        worker.postMessage(3);
        worker.postMessage(4);
    }, 10);
</script>

Open developer tools. Refresh the page.

Expected behavior: each time you refresh the page, "worker received message 1", "worker received message 2"… is printed to the console.

Actual behavior: after refreshing the page, the worker does not receive any messages.

If you comment out the var xhr = new XMLHttpRequest(); line, it works as expected. It also works as expected in Chrome and Firefox.

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Ibrahim O.”

      Changed Status to “Fixed”

    • Thank you for your feedback. We would like to inform you that this issue has been previously identified and the fix is currently available in the insider preview which will be also available in the public stable version in upcoming updates soon.  

      Best regards,
      The MS Edge Team 

    You need to sign in to your Microsoft account to add a comment.

    Sign in