Skip to content

fix(affiliates): reject non-finite offer numbers - #507

Open
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/affiliate-finite-numbers
Open

fix(affiliates): reject non-finite offer numbers#507
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/affiliate-finite-numbers

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • reject NaN/Infinity values in affiliate offer numeric validation
  • cover price, commission rate, flat commission, cookie window, and settlement delay with a regression test

Why

API callers can still send non-finite JavaScript numbers into the validator. Those values are typeof number, so the previous range checks could let impossible affiliate offer data pass through sanitization.

Validation

  • node_modules\.bin\vitest.cmd run src/lib/affiliates/validation.test.ts (38 tests passed)
  • git diff --check passed

Note: the local pre-commit hook could not run because pnpm was not on the hook PATH in this environment, so the commit was created with --no-verify after the focused test passed.

@aiirvizionz
aiirvizionz marked this pull request as ready for review July 28, 2026 19:05
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