Skip to content

chore: fix JavaScript lint errors (issue #11936)#11949

Open
bhumikasudarshani-cmd wants to merge 6 commits intostdlib-js:developfrom
bhumikasudarshani-cmd:fix/dispatch-workflow-invalid-date
Open

chore: fix JavaScript lint errors (issue #11936)#11949
bhumikasudarshani-cmd wants to merge 6 commits intostdlib-js:developfrom
bhumikasudarshani-cmd:fix/dispatch-workflow-invalid-date

Conversation

@bhumikasudarshani-cmd
Copy link
Copy Markdown
Contributor

@bhumikasudarshani-cmd bhumikasudarshani-cmd commented May 5, 2026

Fixes a RangeError: Invalid time value crash in dispatch-workflow/lib/query.js where Date.toISOString() was called on an invalid Date object.

When an HTTP request fails and the response has no rate limit headers, info.reset is undefined. This means undefined * 1000 = NaN, and new Date(NaN) produces an invalid Date. Calling .toISOString() on it throws a RangeError which crashes ESLint entirely.

Fix

Added an isFinite() guard on line 86 of query.js:

Before:

debug( 'Rate limit reset: %s', (new Date( info.reset*1000 )).toISOString() );

After:

debug( 'Rate limit reset: %s', ( isFinite( info.reset ) ? new Date( info.reset*1000 ) : new Date() ).toISOString() );

resolves #11936

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 5, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label May 5, 2026
@bhumikasudarshani-cmd bhumikasudarshani-cmd force-pushed the fix/dispatch-workflow-invalid-date branch from c43abba to 661a8bf Compare May 5, 2026 12:25
@bhumikasudarshani-cmd bhumikasudarshani-cmd requested a review from a team May 5, 2026 12:25
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented May 5, 2026

Coverage Report

Package Statements Branches Functions Lines
symbol/async-iterator $\color{green}95/95$
$\color{green}+0.00%$
$\color{red}2/3$
$\color{green}+0.00%$
$\color{green}0/0$
$\color{green}+0.00%$
$\color{green}95/95$
$\color{green}+0.00%$
utils/constructor-name $\color{green}126/126$
$\color{green}+0.00%$
$\color{green}12/12$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}126/126$
$\color{green}+0.00%$

The above coverage report was generated for the changes in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

2 participants