Skip to content

Cap failure reason length and strip newlines in TransferFailureStore - #125

Merged
Zaldaryon merged 1 commit into
indevfrom
fix/bound-failure-reason-length
Aug 19, 2026
Merged

Cap failure reason length and strip newlines in TransferFailureStore#125
Zaldaryon merged 1 commit into
indevfrom
fix/bound-failure-reason-length

Conversation

@Zaldaryon

Copy link
Copy Markdown

TransferFailureStore.Add now sanitizes the Reason field at the single entry gate for all failure notices:

  • Replace newline and carriage-return characters with spaces.
  • Truncate to 200 characters.
  • Null or whitespace-only reasons fall back to the existing default.

All current Nimbus-produced reasons are well under 100 characters. The cap guards against plugin CancelReason text or exception messages reaching a player's screen as a paragraph.

Three tests added: newline stripping, length cap, null fallback. All 312 registry tests pass.

Fixes #123

TransferFailureStore.Add now sanitizes the Reason field before storing:
replace newline and carriage-return characters with spaces, then truncate
to 200 characters. Null or whitespace-only reasons fall back to the
existing default string.

Fixes #123
@sonarqubecloud

Copy link
Copy Markdown

@Zaldaryon
Zaldaryon merged commit 341f4e7 into indev Aug 19, 2026
4 checks passed
@Zaldaryon
Zaldaryon deleted the fix/bound-failure-reason-length branch August 19, 2026 01:08
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