Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix race-condition with worker API #2046

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

josepot
Copy link
Contributor

@josepot josepot commented Nov 23, 2024

Fixes #2045

@josepot josepot requested a review from tomaka as a code owner November 23, 2024 16:20
@josepot josepot changed the title fix race-condition with worker API (#2045) fix race-condition with worker API Nov 23, 2024
if (mem.byteLength < responseInfo + 8)
return null

const len = buffer.readUInt32LE(mem, responseInfo + 4) >>> 0;
Copy link
Contributor Author

@josepot josepot Nov 23, 2024

Choose a reason for hiding this comment

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

In some instances, the buffer is initialized but it still doesn't have the data for reading the len in it. The new condition exists if the len can't be read, instead of throwing a runtime error.

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.

RangeError [Error] when using startFromWorker API
1 participant