From 89dff36246817120b8f562608853d9d175769320 Mon Sep 17 00:00:00 2001 From: wouterlucas Date: Fri, 3 Oct 2025 13:42:24 +0200 Subject: [PATCH 1/2] fix: emit texture failure event only after exhausting retry attempts --- src/core/CoreNode.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/CoreNode.ts b/src/core/CoreNode.ts index 331bc219..22ad2e66 100644 --- a/src/core/CoreNode.ts +++ b/src/core/CoreNode.ts @@ -918,10 +918,16 @@ export class CoreNode extends EventEmitter { this.notifyParentRTTOfUpdate(); } - this.emit('failed', { - type: 'texture', - error, - } satisfies NodeTextureFailedPayload); + // only emit failed outward if we've exhausted all retry attempts + if ( + this.texture !== null && + this.texture.retryCount > this.texture.maxRetryCount + ) { + this.emit('failed', { + type: 'texture', + error, + } satisfies NodeTextureFailedPayload); + } }; private onTextureFreed: TextureFreedEventHandler = () => { From d1b0d640947485b5f22da79a7cb230e8b5bce58a Mon Sep 17 00:00:00 2001 From: jfboeve Date: Mon, 6 Oct 2025 13:00:04 +0200 Subject: [PATCH 2/2] fix: subtexture failed state --- src/core/textures/SubTexture.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/textures/SubTexture.ts b/src/core/textures/SubTexture.ts index 5b3e329b..a2cdb5f4 100644 --- a/src/core/textures/SubTexture.ts +++ b/src/core/textures/SubTexture.ts @@ -137,6 +137,8 @@ export class SubTexture extends Texture { }; private onParentTxFailed: TextureFailedEventHandler = (target, error) => { + //decrement with 1 because in the failed state it will do +1 again. + this.retryCount = this.parentTexture.retryCount - 1; this.forwardParentTxState('failed', error); };