Skip to content

AudioLoader: Fix race condition with loading manager.#33378

Merged
Mugen87 merged 2 commits intomrdoob:devfrom
Mugen87:dev1
Apr 13, 2026
Merged

AudioLoader: Fix race condition with loading manager.#33378
Mugen87 merged 2 commits intomrdoob:devfrom
Mugen87:dev1

Conversation

@Mugen87
Copy link
Copy Markdown
Collaborator

@Mugen87 Mugen87 commented Apr 13, 2026

Fixed #10706.

Description

Another attempt to fix #10706. I've realized there is a much cleaner approach to fix the race condition in AudioLoader that potentially occurs when used with LoadingManager.

To recap: LoadingManager can fire too early when the audio isn't decoded yet so if you attempt to playback such an audio you run into runtime errors. However, by using a separate "decode item", it's possible to keep the LoadingManager waiting until the decode has finished.

This change requires no changes in FileLoader which was a blocker of previous PRs.

@Mugen87 Mugen87 added this to the r184 milestone Apr 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 361.21
85.78
361.21
85.78
+0 B
+0 B
WebGPU 637.48
177.06
637.48
177.06
+0 B
+0 B
WebGPU Nodes 635.59
176.76
635.59
176.76
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 493.58
120.42
493.58
120.42
+0 B
+0 B
WebGPU 709.22
191.88
709.22
191.88
+0 B
+0 B
WebGPU Nodes 658.44
179.17
658.44
179.17
+0 B
+0 B

@Mugen87 Mugen87 merged commit 3612474 into mrdoob:dev Apr 13, 2026
10 checks passed
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.

AudioLoader and LoadingManager onLoad Race

1 participant