Skip to content

fix OOC errors from validateUserInput on steps#1088

Closed
bwp91 wants to merge 2 commits intolatestfrom
fix/steps
Closed

fix OOC errors from validateUserInput on steps#1088
bwp91 wants to merge 2 commits intolatestfrom
fix/steps

Conversation

@bwp91
Copy link
Contributor

@bwp91 bwp91 commented Mar 22, 2025

See issue in #1077.

Please check the unit tests to ensure the correct values are being stored for the user 'input' value.

@bwp91 bwp91 requested a review from adriancable March 22, 2025 22:40
@bwp91 bwp91 requested a review from hjdhjd March 22, 2025 22:40
@github-actions github-actions bot added the fix label Mar 23, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 14017382969

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.009%) to 64.347%

Totals Coverage Status
Change from base Build 14017380819: 0.009%
Covered Lines: 6239
Relevant Lines: 9299

💛 - Coveralls

@bwp91 bwp91 requested a review from Copilot April 3, 2025 19:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes out-of-bound errors in the validateUserInput function by adjusting how the maximum numeric value is handled using the provided step value. Key changes include:

  • Changing numericMax from a constant to a mutable variable and quantizing it based on the step.
  • Adding unit tests to verify max value adjustment, quantization, and input truncation.
  • Fixing a typo in one of the test descriptions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/lib/Characteristic.ts Adjusts numericMax calculation by applying step-based rounding to the maximum value.
src/lib/Characteristic.spec.ts Adds unit tests to ensure validateUserInput correctly adjusts and truncates input values.
Comments suppressed due to low confidence (1)

src/lib/Characteristic.ts:2731

  • [nitpick] Consider renaming 'numericMax' after adjustment to 'adjustedNumericMax' to better reflect its modified value.
if (numericMax != null) {

@bwp91 bwp91 requested review from NorthernMan54 and ebaauw April 13, 2025 17:46
@bwp91 bwp91 requested review from NorthernMan54, donavanbecker, ebaauw and hjdhjd and removed request for NorthernMan54, adriancable, ebaauw and hjdhjd June 1, 2025 12:49
@bwp91 bwp91 closed this Jun 8, 2025
@bwp91 bwp91 deleted the fix/steps branch June 8, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants