Skip to content

Comments

fix(topup): unify whitespace normalization with DuplicationPreventionService#475

Merged
RicherTunes merged 1 commit intomainfrom
fix/topup-normalize-whitespace
Feb 13, 2026
Merged

fix(topup): unify whitespace normalization with DuplicationPreventionService#475
RicherTunes merged 1 commit intomainfrom
fix/topup-normalize-whitespace

Conversation

@RicherTunes
Copy link
Owner

Summary

  • TopUpPlanner.NormalizeTopUpKey() used Trim().ToLowerInvariant() while DuplicationPreventionService.NormalizeString() used Regex.Replace(\s+, " ") before lowercasing
  • This mismatch meant items with multiple internal spaces could bypass top-up deduplication
  • Aligns TopUpPlanner to use the same regex whitespace collapse pattern

This is the secondary fix from the TopUp flakiness investigation (#474). The primary fix (MusicBrainzResolver catch block) was merged in #474; this addresses the normalization inconsistency identified during root cause analysis.

Test plan

  • All 7 TopUp-related tests pass
  • Full suite: 2269 passed, 0 failed, 9 skipped
  • CI passes

🤖 Generated with Claude Code

…Service

TopUpPlanner.NormalizeTopUpKey() used Trim().ToLowerInvariant() while
DuplicationPreventionService.NormalizeString() used Regex.Replace(\s+, " ")
before lowercasing. This mismatch meant items with multiple internal
spaces (e.g. "Lana  Del  Rey") could bypass top-up deduplication.

Align TopUpPlanner to use the same regex whitespace collapse.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RicherTunes RicherTunes merged commit 225f332 into main Feb 13, 2026
24 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

Development

Successfully merging this pull request may close these issues.

1 participant