Skip to content

v4.19.2 - Optimized Data Masking

Choose a tag to compare

@jongpie jongpie released this 12 Aug 13:52
· 5 commits to main since this release
22d0101

Thanks to @EnglundAndreas for reporting issue #639 and thanks to @anthonygiuliano for fixing it in PR #959 🥳

Core Unlocked Package Changes

Fixed #639 System.LimitException: Regex too complicated when LogEntryEventBuilder.applyDataMaskRules processes long strings (~35K+ chars).

The existing chunking logic in applyDataMaskRuleToLongLine had three issues that this release addresses:

  • Longest-match deduplication: When two overlapping chunks find a match at the same start position, the old code kept whichever was found first (shorter context). Now keeps the longest match, since the chunk with more trailing context produces the most accurate result.
  • Sorted left-to-right processing: The old code processed matches in discovery order across chunks, which isn't guaranteed to be left-to-right. Now explicitly sorts start positions and skips matches consumed by previous replacements.
  • Single-pass expandReplacement: The old iterative String.replace('$' + i, groups[i]) reinterpreted $N patterns inside captured group values (e.g., if group 1 captured PRICE:$3, the $3 would be replaced with group 3's value). The new implementation scans the replacement template left-to-right, only interpreting $N in the template itself — matching Java's Matcher.appendReplacement behavior.

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.19.1...v4.19.2