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

[Bug] Abort signal in loadOptions not working with ScenegraphLayer #2541

Open
sprokazin opened this issue Jul 10, 2023 · 2 comments
Open

[Bug] Abort signal in loadOptions not working with ScenegraphLayer #2541

sprokazin opened this issue Jul 10, 2023 · 2 comments

Comments

@sprokazin
Copy link

Description

One way to cancel requests for an existing layer is to use loadOptions.

loadOptions: { fetch: { signal: abortSignal } }

This method works great for Tile3DLayer:

image

However, when I try to use the abortSignal in the same way for ScenegraphLayer, I get an error that crashes the app

image

Expected Behavior

ScenegraphLayer should be able to handle abort signals properly. This is essential for the layers to work well with AbortController. Right now, I have no way to cancel requests for these layers, which leads to performance issues for the app, which keeps making unnecessary requests.

Steps to Reproduce

I created a separate repository where I reproduced this error. The repository is open and accessible at this link: https://github.com/sprokazin/deck-cancel-glb. Steps to reproduce the bug:

  1. Run the project.
  2. Open the developer tools window, open the ‘Network’ tab
  3. Check the box ‘Disable cache’
  4. If you have a very fast internet, you can enable throttling
  5. Refresh the page, and, before the request for loading the .glb model is completed, click on the Abort button in the top left corner of the window.
  6. This action will cause an error, shown in the screenshot below

image

Environment

  • Framework version: deck.gl@8.9.19
  • Browser: Chrome 114.0.5735.199
  • OS: Windows 10, Windows 11, Ubuntu 22.04.2
@ibgreen
Copy link
Collaborator

ibgreen commented Jul 10, 2023

ScenegraphLayer is a deck.gl concept. We need to reformulate this task in terms of GLTFLoader. Presumably the passing of fetch options to subloaders.

Also, it looks like there is a pending fix for the above exception thrown by deck.gl ScenegraphLayer (which happens when it wraps the actual error with extra information). It would be good to understand what the actual error was (either by checking it in the debugger or rerunning the code when the pending fix is published)

@ibgreen
Copy link
Collaborator

ibgreen commented Jul 10, 2023

@belom88 are you able to check if we are passing loadOptions through to the GLTFLoader sub-loaders? Specifically, loadOptions.fetch.signal ?

The idea is to be able to cancel all outstanding sub requests (for textures, draco meshes etc) with a single AbortController

Apparently this does work for 3D tiles.

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