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

GLTF loader will not resolve when load cdn url with invalid query q #2439

Open
Sway007 opened this issue Nov 15, 2024 · 0 comments
Open

GLTF loader will not resolve when load cdn url with invalid query q #2439

Sway007 opened this issue Nov 15, 2024 · 0 comments
Assignees
Labels
bug Something isn't working high priority High priority issue resource Resource-related functions

Comments

@Sway007
Copy link
Member

Sway007 commented Nov 15, 2024

Bug description

below snippets will not resolve

engine.resourceManager
    .load({
      type: AssetType.GLTF,
      url: 'https://mdn.alipayobjects.com/oasis_be/afts/file/A*ZZoRTbS5OocAAAAAAAAAAAAADkp5AQ/6cb8f543-285c-491a-8cfd-57a1160dc9ab.glb?q=invalid',
    })
    .then((item) => {
      console.log('success:', item);
    });

Solution

The value of query q is reserved by ResourceManger for sub assets uri path. Invalid query q will let ResourceManger find an not exist resource, then an never resolve promise is produced.

  1. ResourceManger should validate query q before find sub assets.
  2. ResourceManger should throw an error if failed to find sub assets instead of leaving an unresolved promise.
@Sway007 Sway007 added bug Something isn't working resource Resource-related functions high priority High priority issue labels Nov 15, 2024
@Sway007 Sway007 self-assigned this Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority High priority issue resource Resource-related functions
Projects
None yet
Development

No branches or pull requests

1 participant