Skip to content

FileLoader cannot handle request.abort() #14652

@okitu

Description

@okitu

The change, that let's FileLoader cache duplicate requests by default, introduced a problem, when aborting a request before it's loaded.

XMLHttpRequest.abort() does not tirgger 'load' or 'error' events but instead an 'abort' event.

Because that event is not handled, the request will be stuck in the FileLoaders 'loading' object, that is used to determine, if a file is already loading.

Demo jsfiddle

By adding a listener for 'abort' this could be prevented:

request.addEventListener( 'abort', function ( event ) {
    ... handle the same way an error would be handled
}, false );

I'm not sure, if handling it as an error is the way to go, because aborting has to be called on purpose, but this is how i do it for now.

Three.js version
  • r88+
Browser
  • All of them
OS
  • All of them

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions