fix(support): match compliance search address case-insensitively#3824
Open
TaprootFreak wants to merge 2 commits into
Open
fix(support): match compliance search address case-insensitively#3824TaprootFreak wants to merge 2 commits into
TaprootFreak wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The compliance database search returns "No user or bankTx found" when an EVM address is entered in a different letter case than it is stored. Addresses are persisted in EIP-55 checksummed form, so a non-checksummed (e.g. all-lowercase) address — as commonly copied from block explorers — is never found.
Root cause
The address branch of
SupportService.getUniqueUserDataByKeylooked addresses up with exact, case-sensitive=comparisons (WHERE user.address = :param,WHERE deposit.address = :param). On Postgres these are case-sensitive, so a lowercase input does not match the stored checksummed value and the search falls through to the not-found error. This affected both lookups in that branch:Fix
Case-insensitive matching for the compliance search address branch only, via dedicated methods:
UserService.getUserByAddressIgnoreCase(address)SellService.getSellByDepositAddressIgnoreCase(address)SwapService.getSwapByDepositAddressIgnoreCase(address)Each uses
LOWER(<col>) = LOWER(:address)and loads the exact same relations as the previous lookup, so downstream behaviour is unchanged apart from being case-insensitive.The shared
getUserByKey,getUserByAddress,getSellByKeyandgetSwapByKeystay untouched, so authentication, KYC, history and every other caller keep their existing exact-match behaviour.Tests
WHEREclause for each of the three new methods.Scope
Read-only admin search only — no change to authentication or any address-write path.