Skip to content

Fix settlement cancel reason length#190

Merged
Jagadeeshftw merged 3 commits into
AnchorNet-Org:mainfrom
d3v-active:fix-settlement-cancel-reason-length
Jul 22, 2026
Merged

Fix settlement cancel reason length#190
Jagadeeshftw merged 3 commits into
AnchorNet-Org:mainfrom
d3v-active:fix-settlement-cancel-reason-length

Conversation

@d3v-active

Copy link
Copy Markdown
Contributor

Closes #159

Added a 500-character maximum length validation on the optional reason field in SettlementService.cancel.

Motivation and Context
This prevents potential storage-amplification and log-noise issues caused by unbounded client-supplied text, while keeping the existing optional, non-blank behavior unchanged.

Changes

  • Added requireStringMaxLength to src/utils/validation.ts.
  • Applied requireStringMaxLength to SettlementService.cancel in src/services/settlementService.ts to enforce a 500-character limit.
  • Added unit tests in src/services/settlementService.test.ts.
  • Added integration tests in src/routes/settlements.test.ts.

@Jagadeeshftw
Jagadeeshftw merged commit 872250a into AnchorNet-Org:main Jul 22, 2026
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.

Add a max-length validation on SettlementService.cancel's optional reason field

2 participants