Skip to content

Utilities WebRequestRest Rest.GetAsync() Causes Unity To Hang #10766

@t-mklein

Description

@t-mklein

Describe the bug

When Rest.GetAsync(downloadUrl, readResponseData: true) is called with a download uri for a 79.9KB OneDrive file, Unity hangs for about a minute, with both the running player and Unity Editor completely frozen.

To reproduce

  1. Generate a download uri for a file (the larger the file, the longer Unity hangs). I used a download uri for a OneDrive file.
  2. In a Unity scene, include a script with an async function with the lines:
    (i) Response response = new Response();
    (ii) response = await Rest.GetAsync(downloadUrl, readResponseData: true);
  3. Run the scene so that the async function is called. When the program executes line (ii) from Step 2, Unity hangs.

Expected behavior

In MRTK v2.7.3, Unity does not hang, but after updating to v2.8.0 it does.

Setup

  • Unity Version [2020.3.35f1]
  • MRTK Version [v2.8.0]

Target platform

  • HoloLens 2

Additional context

In Rest.cs, line 375/376 there used to be an async call when creating a Response to return if readResponseData is true, and now there is a different call.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions