Skip to content

fix: improve compliance name search#3374

Merged
TaprootFreak merged 6 commits intodevelopfrom
fix/compliance-name-search
Mar 10, 2026
Merged

fix: improve compliance name search#3374
TaprootFreak merged 6 commits intodevelopfrom
fix/compliance-name-search

Conversation

@TaprootFreak
Copy link
Collaborator

@TaprootFreak TaprootFreak commented Mar 9, 2026

Summary

  • Compliance name search (getUsersByName) now tries all possible split points in both firstname/surname orders, so reversed name input (e.g. "Surname Firstname") finds the same results as "Firstname Surname"
  • Additionally strips title-like words ending with . (e.g. "Dr.", "Prof.") for extra split combinations without discarding the original input
  • Same improvement applied to bank transaction name search (getBankTxsByName): reversed splits and title-filtered full-string search for name and ultimateName fields
  • Replaces the previous logic that only tried a single fixed split point in one direction

Test plan

  • Search by "Firstname Surname" → finds user + bank transactions
  • Search by "Surname Firstname" → finds user + bank transactions (was broken before)
  • Search with title prefix (e.g. "Dr. Firstname Surname") → finds user + bank transactions
  • Search with single word → still works (full-text match on firstname/surname/verifiedName)
  • Search by IBAN, email, ID → unchanged behavior
  • Verify no regressions on existing compliance search functionality

…dling

The name search only tried splitting input as "firstname surname" but
not the reversed order. Searching "Surname Firstname" would fail to
find a user stored as firstname=Firstname, surname=Surname.

Now tries all possible split points in both orders and additionally
strips title-like words ending with "." (e.g. "Dr.", "Prof.") for
an extra set of split combinations without discarding the original input.
The BankTx name search had the same reversed-order issue. Now also
tries reversed splits and title-filtered variants for the name and
ultimateName fields.
Limit split parts to 5 to prevent unbounded iteration over
user-controlled input (CodeQL js/loop-bound-injection).
5 parts covers any realistic name including titles.
@TaprootFreak TaprootFreak force-pushed the fix/compliance-name-search branch from 9954206 to d06ff14 Compare March 9, 2026 11:18
Prevents bad LIKE queries from double-space input (e.g. "%%"
matching everything).
@TaprootFreak TaprootFreak marked this pull request as ready for review March 9, 2026 11:36
@davidleomay davidleomay force-pushed the fix/compliance-name-search branch from 698236f to 1f52791 Compare March 10, 2026 10:31
@TaprootFreak TaprootFreak merged commit de97576 into develop Mar 10, 2026
13 checks passed
@TaprootFreak TaprootFreak deleted the fix/compliance-name-search branch March 10, 2026 10:39
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.

2 participants