Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/core/CoreNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
2 changes: 2 additions & 0 deletions src/core/textures/SubTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down