Skip to content

fix(memo): enforce the 28-byte limit by default - #956

Merged
BigBen-7 merged 1 commit into
Lead-Studios:mainfrom
snowrugar-beep:fix/issue-818-enforce-memo-max-length
Oct 17, 2026
Merged

BigBen-7 merged 1 commit into
Lead-Studios:mainfrom
snowrugar-beep:fix/issue-818-enforce-memo-max-length

Conversation

@snowrugar-beep

Copy link
Copy Markdown
Contributor

Summary

MemoValidationService.validate() now enforces the 28-byte MEMO_TEXT limit by default, instead of only checking length when the caller opted in. An over-length memo is reported as invalid with an error naming the limit and the actual byte length, and the sanitized value is truncated to 28 bytes.

Problem

validate() guarded its length check behind options.enforceMaxLength, which defaulted to undefined. As a result validate({ memo: 'x'.repeat(100) }) returned isValid: true, so an over-length memo that the network would reject sailed straight through validation (#603, #818).

Changes Made

  • src/utils/validation/memo.service.ts: the guard is now options.enforceMaxLength !== false, so the limit applies unless a caller explicitly opts out.
  • src/utils/validation/memo.types.ts: updated the enforceMaxLength documentation to describe the new default.

Implementation Details

Length enforcement is now on by default; passing enforceMaxLength: false remains the single explicit opt-out. The existing behaviour for an over-length memo is otherwise unchanged — isValid is false, error names both the limit and the supplied byte count (e.g. Memo exceeds max length of 28 bytes (got 100)), and sanitizedMemo is truncated to the first 28 bytes so a UI still has a usable value. Short memos are unaffected.

Closes #820

Closes #819

Closes #818

MemoValidationService.validate() only checked length when
enforceMaxLength was true, which defaulted to undefined, so an over-length
memo validated as isValid: true. Enforce MEMO_MAX_BYTES unless the caller
explicitly passes enforceMaxLength: false.
@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@snowrugar-beep Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@BigBen-7
BigBen-7 merged commit 6d8f538 into Lead-Studios:main Oct 17, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants