Skip to content

fix: Add error handling for message processing in KTX worker#11768

Merged
Zyie merged 2 commits intopixijs:devfrom
zardoy:ktx2-errors
Dec 8, 2025
Merged

fix: Add error handling for message processing in KTX worker#11768
Zyie merged 2 commits intopixijs:devfrom
zardoy:ktx2-errors

Conversation

@zardoy
Copy link
Contributor

@zardoy zardoy commented Nov 24, 2025

Description of change
Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

Hello! Sorry, opened a PR a bit early via vscode popup without linking to a correct issue.

In short, this is an enhancement improvement so errors would popup correctly to a place where the .load was called, without this it's almost impossible to track what source triggered an issue and code in the main thread would hang forever.

Example of the stack that you would now be able to see:

Uncaught (in promise) Error: [Loader.load] Failed to load blob:http://localhost:3001/b4c9f365-a446-4bcd-894f-8d08bfe91fd5.
Error: Unable to transcode basis texture.
    at _Loader._loadAssetWithRetry (Loader.mjs:202:1)
    at async Loader.mjs:122:1
    at async Promise.all (:3001/index 0)
    at async _Loader.load (Loader.mjs:127:1)
    at async AssetsClass._mapLoadToResolve (Assets.mjs:527:1)
    at async AssetsClass.load (Assets.mjs:212:1)
    at async testSeqLoad (main.ts:227:1)

@Zyie Zyie changed the title fix(ktx.worker): Add error handling for message processing in KTX worker fix: Add error handling for message processing in KTX worker Nov 24, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 24, 2025

commit: 91c716c

@zardoy
Copy link
Contributor Author

zardoy commented Nov 24, 2025

im not sure if its worth a dedicated issue
However, as I was debugging it I noticed that memory usage never goes down as I load more textures
I think it would be useful to expose worker and worker code for some adjustments e.g. so you can terminate it or easily patch code for it

@zardoy
Copy link
Contributor Author

zardoy commented Nov 30, 2025

Hey I also added error stack restoration so the stack of the actual error pops up in the console. Alternatively, I could use the cause argument of an Error here.

@zardoy zardoy requested a review from bigtimebuddy November 30, 2025 04:08
@Zyie Zyie added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label Dec 2, 2025
@Zyie Zyie added this pull request to the merge queue Dec 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 8, 2025
@Zyie Zyie added this pull request to the merge queue Dec 8, 2025
Merged via the queue into pixijs:dev with commit 0e513d7 Dec 8, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants