Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call onProgress, onError of duplicate requests in FileLoader #12454

Closed
3 of 13 tasks
ngokevin opened this issue Oct 21, 2017 · 1 comment
Closed
3 of 13 tasks

Call onProgress, onError of duplicate requests in FileLoader #12454

ngokevin opened this issue Oct 21, 2017 · 1 comment

Comments

@ngokevin
Copy link
Contributor

Description of the problem

Duplicate request handling in #12434

In case of an error on the request, we should notify the rest of the duplicate .load() callbacks (onError). Similarly, we can call onProgress to every duplicate .load() call callback.

Three.js version
  • Dev
  • r87
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)
@takahirox
Copy link
Collaborator

takahirox commented Oct 21, 2017

I've found another issue.

When Cache.enabled is false, duplicate requests aren't handled correctly because cached is always undefined here

if ( cached !== undefined ) {

and loading[ url ] isn't deleted when callback function is called.

for ( var i = 0; i < callbacks.length; i ++ ) {
callbacks[ i ]( response );
}
delete loading[ url ];

then calllback function is registered again here.

if ( loading[ url ] !== undefined ) {
loading[ url ].push( function () {
scope.load( url, onLoad, onProgress, onError );
} );
return;
}

I'm trying to fix all...

/cc @mrdoob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants