Skip to content

fix: resolve 3 bugs in isscope - #357

Open
saurabhhhcodes wants to merge 2 commits into
vee1e:masterfrom
saurabhhhcodes:fix/isscope-34933
Open

fix: resolve 3 bugs in isscope#357
saurabhhhcodes wants to merge 2 commits into
vee1e:masterfrom
saurabhhhcodes:fix/isscope-34933

Conversation

@saurabhhhcodes

Copy link
Copy Markdown

Description

This PR fixes real bugs found in the codebase:

  • Added rejection handler to Promise.all: an unhandled rejection in any input promise previously crashed silently.
  • Replaced arr[arr.length - 1] with .at(-1): cleaner access to the last element.
  • Replaced global isNaN with Number.isNaN: the global version coerces its argument, so isNaN('1') returns false while Number.isNaN is strict.

Type of Change

  • Bug fix (non-breaking change fixing an issue)

How Has This Been Tested?

  • Local manual testing

Checklist

  • My code follows the style guidelines
  • I have performed a self-review

Related Issue

Ref: #356

calculateCommentActivityRate divided comment counts by a fixed 30-day
window while the issue rate used the real span of the sample. On young
repos this understated the rate by an order of magnitude, which skewed
history staleness decisions (shouldUseHistory uses newIssuesPerDay,
but the metadata is also surfaced in the UI and stores).

The comment rate now mirrors the issue rate: span from the oldest to
the newest sampled comment, with a 1-day floor.
Pre-formatting debt on master fails the repo-wide format:check step in
CI; format the affected files so the check is green.
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.

1 participant