Skip to content

Fix byte-safe memo truncation edge case in Stellar memo handling - #1276

Merged
OlaGreat merged 1 commit into
OlaGreat:mainfrom
Biokes:fixaro
Sep 29, 2026
Merged

OlaGreat merged 1 commit into
OlaGreat:mainfrom
Biokes:fixaro

Conversation

@Biokes

@Biokes Biokes commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a narrow edge case in truncateMemoToStellarLimit where a memo could still receive a spurious Unicode replacement character (�) after truncation.

Previously, the safety check for a broken UTF-8 boundary was gated on whether the original input already contained a replacement character. That meant a memo that legitimately contained � before the truncation cut point could bypass the guard, and in a rare case the truncated byte tail could still re-encode to the same byte length while injecting an extra replacement character.

This patch removes that extra condition and relies only on the byte round-trip-length check to detect a broken truncation boundary.

File changed

  • frontend/src/components/support-panel.tsx

What changed

  • Updated truncateMemoToStellarLimit so it detects invalid truncation boundaries based solely on whether the decoded output still round-trips to the same byte length.
  • Removed the original guard that checked !input.includes("�").
  • Keeps the existing byte-safe truncation behavior for multibyte UTF-8 characters and prevents accidental injection of replacement characters in the memo.

Closes #1238
Closes #1239
Closes #1240
Closes #1241

Refactor UTF-8 decoding logic and clean up SVG path data.
@Biokes
Biokes requested a review from OlaGreat as a code owner September 29, 2026 18:14
@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@Biokes 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

@OlaGreat
OlaGreat merged commit da5841c into OlaGreat:main Sep 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment