Warn and fail GLB loading when Draco decoder is unavailable#8868
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents Draco-compressed GLB loads from hanging indefinitely when the Draco decoder is missing/misconfigured or fails to download/compile, by surfacing the failure as a warning and a proper asset load error.
Changes:
- Make
createDracoMeshtreat a non-initializeddracoDecode()call as a hard failure: emit aDebug.warnOncewith configuration guidance and reject the mesh decode promise. - Add a failure mode to the Draco decode job queue so worker initialization errors fail all pending decode callbacks and cause future decode requests to fail immediately.
- Emit a
Debug.warnOnceon Draco decoder initialization failure including attempted URLs and the underlying error.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/framework/parsers/glb-parser.js | Rejects Draco mesh decode promises (and warns once) when the decoder isn’t configured, avoiding permanent hangs. |
| src/framework/parsers/draco-decoder.js | Adds queue failure propagation and warns once when worker initialization fails, so queued/future decode requests error instead of stalling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, loading a Draco-compressed GLB without a configured Draco decoder would hang the asset load forever with no error or warning, in two distinct ways: the decoder config being missing/invalid (decode requests silently dropped), and the decoder script/wasm failing to download or compile (decode jobs queued into a dead worker pool).
Changes:
createDracoMeshnow checks the return value ofdracoDecode(); when the decoder is not configured, it emits aDebug.warnOnceexplaining how to configure it (dracoInitialize()/WasmModule.setConfig('DracoDecoderModule', ...)) and rejects the mesh promise so the asset fires itserrorevent instead of hanging.Debug.warnOncewith the attempted URLs and underlying error, and fails the job queue: pending decode callbacks receive the error and future decode requests fail immediately.Neither warning can fire spuriously — both correspond to states the load can never recover from. No change to successful load paths; decode requests issued while the decoder is still downloading continue to be queued and processed as before.