Skip to content

Warn and fail GLB loading when Draco decoder is unavailable#8868

Merged
mvaligursky merged 1 commit into
mainfrom
mv-draco-silent-fail
Jun 10, 2026
Merged

Warn and fail GLB loading when Draco decoder is unavailable#8868
mvaligursky merged 1 commit into
mainfrom
mv-draco-silent-fail

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

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:

  • createDracoMesh now checks the return value of dracoDecode(); when the decoder is not configured, it emits a Debug.warnOnce explaining how to configure it (dracoInitialize() / WasmModule.setConfig('DracoDecoderModule', ...)) and rejects the mesh promise so the asset fires its error event instead of hanging.
  • Draco worker initialization now catches download/compile failures, emits a Debug.warnOnce with 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 createDracoMesh treat a non-initialized dracoDecode() call as a hard failure: emit a Debug.warnOnce with 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.warnOnce on 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.

@mvaligursky mvaligursky merged commit fd9d063 into main Jun 10, 2026
10 checks passed
@mvaligursky mvaligursky deleted the mv-draco-silent-fail branch June 10, 2026 13:50
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

Successfully merging this pull request may close these issues.

2 participants