fix(kyc): let compliance accounts reach an identification again - #4598
Draft
Blume1977 wants to merge 1 commit into
Draft
fix(kyc): let compliance accounts reach an identification again#4598Blume1977 wants to merge 1 commit into
Blume1977 wants to merge 1 commit 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.
The problem
A Compliance account currently has no reachable path to a
verifiedName, and since the staff-clearance rule (#4395 → #4572) an account without one is refused every elevated endpoint. Two guards from #3577 close both doors:kyc.service.tsrejected every KYC call for a Compliance account (KYC not allowed for compliance accounts) — so the "Start KYC" button the staff-clearance screen offers (services#1233) always ended in a raw error.UserData.checkIfMergePossibleWithblocked every merge involving a Compliance account — so entering the mail address of one's own already-identified account producedAccount already existsand no merge request, becauseisMergePossibleWithreturned false.#3577 predates the clearance rule; the two protections were never reconciled. The result is a permanent lockout that only an operator-run migration can lift (#4574, #4590, #4596 are three such one-off backfills in three days).
What changed
docs/staff-kyc-clearance.mddescribe as the identity-verified path.checkIfMergePossibleWith(slave, isMailMerge)keeps the block absolute for the merges the system derives on its own (MergeReason.IBAN,MergeReason.IDENT_DOCUMENT) and lifts it only forMergeReason.MAIL— the merge the account owner triggers by entering an address and completes by opening a link delivered to the other account's mailbox, so the same person demonstrably controls both sides.sendMergeRequestand carried throughexecuteMerge→mergeUserData, because the check runs a second time against freshly loaded entities at confirmation time.Checks
compliance-merge-exemption.spec.ts: block holds by default in both directions, exemption applies on the mail path only, name-mismatch still throws, non-compliance accounts unaffected.account-merge.service.spec.ts: the reason→flag derivation is pinned for MAIL/IBAN/IDENT_DOCUMENT on both the request and the execution side (a hard-codedtrueorfalsefails).account-merge.processing.spec.tsassertion updated to the new signature.tsc --noEmitclean.Note
This lifts part of a protection added in #3577, whose PR description carries no rationale beyond the release checklist — @davidleomay should confirm the narrowed scope still covers what it was written for. With this change, #4596 (the pending one-off backfill) becomes a convenience rather than the only way out, and the dead-end handling in services#1246 is no longer needed.