Fetch API with ReadableStream has bug with data pumping since 14390

Fixed, flighted Issue #8196907

Details

Created
Jul 16, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
14.14390
Fixed in build #
15026
Reports
Reported by 4 people

Sign in to watch or report this issue.

Steps to reproduce

Description:
Use fetch API to visit a large binary file (such as video file), and read binary data via ReadableStream in order to do stream IO. The download progress freezed sliently after a short time (seems 2secs) without any exception throwed, with the download progress unfinished yet.

I implemented an MSE(Media Source Extensions) video player for custom format playback, so that stream IO is important. Fetch+Stream API feature has been stable since chrome 43+, also be found in Edge included in recent insider build. I was excited for feature support in Edge but trouble bug has been found.

On Win10 14366, The content process will crash immediately if download progress freezed. Since recent build (Win10 14379), browser will not crash but download progress keep freezed after short time.

This bug has not been fixed until current build 14390. I hope this can be fixed before rs1 stable release, or troubles will come.

Reproduce code:

function pump(reader, context) {
    return reader.read().then(function (result) {
        if (result.done) {
            console.log('ReadableStreamReader: complete! Received ' + context.receivedLength);
        } else {
            var chunk = result.value;
            console.log('ReadableStreamReader: Partial chunk, chunkSize = ' + chunk.byteLength);

            context.receivedLength += chunk.byteLength;
            return pump(reader, context);
        }
    }).catch(function (e) {
        throw e;
    });
}

function fetchVideo() {
    var url = 'http://127.0.0.1/video/railgun.mkv';

    var headers = new Headers();
    var param = {
        method: 'GET',
        headers: headers,
        mode: 'cors',
        cache: 'default'
    };

    var context = {
        receivedLength: 0
    };

    fetch(url, param).then(function (res) {
        console.log('Content-Length: ' + res.headers.get('Content-Length'));
        return pump(res.body.getReader(), context);
    }).catch(function (e) {
        throw e;
    });
}

Expected result: The download progress should last until download complete. ReadableStreamReader should provide all the binary data by chunks unless cancel is explicit called, or network error occurred.

Attachments show the console output by Chrome 51 and Edge 14390

Attachments

Comments and activity

  • Fix misleading expression:

    This bug still has not been fixed on current build 14390.

  • Microsoft Edge Team

    Changed Assigned To to “Brad E.”

    Changed Title from “Fetch API with ReadableStream has bug with data pumping since 14366” to “Fetch API with ReadableStream has bug with data pumping since 14390”

  • This bug still has not been fixed on current build 14393.

  • Microsoft Edge Team

    Changed Assigned To to “Venkat K.”

    Changed Assigned To from “Venkat K.” to “Brandon M.”

  • Still buggy on build 14905

  • Still buggy on build 14915.1000

    Any plan to fix this bug?

  • Microsoft Edge Team

    Changed Status to “Confirmed”

    Changed Status from “Confirmed” to “In code review”

    Changed Status from “In code review” to “In progress”

    Changed Status from “In progress” to “Fixed, not yet flighted”

    Changed Status from “Fixed, not yet flighted” to “Fixed, flighted”

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

Sign in