Skip to content

fix: include skipQueue in queueSize getter when using AbortSignal#1070

Open
lb1192176991-lab wants to merge 1 commit into
piscinajs:currentfrom
lb1192176991-lab:fix/queueSize-abort-signal
Open

fix: include skipQueue in queueSize getter when using AbortSignal#1070
lb1192176991-lab wants to merge 1 commit into
piscinajs:currentfrom
lb1192176991-lab:fix/queueSize-abort-signal

Conversation

@lb1192176991-lab

Copy link
Copy Markdown

Fixes #1029

When tasks are submitted with an AbortSignal, they may end up in skipQueue instead of taskQueue. The queueSize getter only accounted for taskQueue.length, causing queueSize to report 0 even when tasks were waiting.

This fix adds this.skipQueue.length to the queueSize calculation.

@lb1192176991-lab

Copy link
Copy Markdown
Author

Hi maintainers! 👋

This PR fixes #1029 where queueSize returns 0 when tasks are submitted with an AbortSignal, because the getter only checked taskQueue.length but not skipQueue.length.

The fix is a one-line change: return this.taskQueue.length + this.skipQueue.length;

Would appreciate a review when you have time. Happy to make any adjustments!

Thanks!

@metcoder95 metcoder95 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you just alter the affected file, here it seems you are adding a totally new file

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.

queueSize is incorrect when using AbortSignal

2 participants