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

LoadQueue gets messed up with duplicate "src" items loaded in other queues #274

Open
cmam opened this issue Jul 11, 2021 · 1 comment
Open

Comments

@cmam
Copy link

cmam commented Jul 11, 2021

Issue Details

  • Version used (Ex; 1.0):

1.0.1

  • Describe whats happening (Include any relevant console errors, a Gist is preferred for longer errors):

When having multiple LoadQueue instances, if manifests contain the same file, or the same file with different ID is loaded on a queue, the queue progress is >= 1, causing relevant checks to fail (e.g. is my sound queue ready?). This means that, per queue, the numItems is less than numLoadedItems resulting in the loaded property being false and progress being something greater than 1.

What's concerning is that if I load a manifest on another queue, the "original" queue that happens to have loaded a file from that manifest (i.e. same "src" property), gets messed up as described above.

Example:

m1 = [ {src: 'path/sound.ogg', id: 's1' } ];
m2 = [ {src: 'path/sound.ogg', id: 's2' } ];

q1 = new createjs.LoadQueue(true);
q1.installPlugin(createjs.Sound);

q2 = new createjs.LoadQueue(true);
q2.installPlugin(createjs.Sound);

q1.loadManifest(m1);

q1
// All seem good.
loaded: true
progress: 1
numItems: 1
numItemsLoaded: 1

// Load the manifest on the other queue.
q2.loadManifest(m2);

q1
// It gets messed up, for every loadManifest run on any other queue, even though I specify different ID.
loaded: false
progress: 2
numItems: 1
numItemsLoaded: 2

q2
loaded: true
progress: 1
numItems: 1
numItemsLoaded: 1

I hope it makes sense. I guess this has something to do with the global sound registering part, recognizing already loaded "src" paths, but I expect it shouldn't affect the other load queues.

  • OS & Browser version (Please be specific) (Ex; Windows 10 Home, Chrome 62.0.3202.94):

Debian Testing, Google Chrome 91.0.4472.114.

  • Do you know of any workarounds?

None, other than having to create duplicate files in different paths in order to avoid this.

  • Provide any extra details that will help us fix your issue. Including a link to a CodePen.io or JSFiddle.net example that shows the issue in isolation will greatly increase the chance of getting a quick response.
@danzen
Copy link
Contributor

danzen commented Jul 24, 2023

This does make sense. If you can dig into the preloadjs code and see what can be done to avoid it, that would be great. The main devs are on to other things but we are doing our best to maintain issues - somewhat as a community. So ideally, that would be through a pull request. Cheers.

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

2 participants