Release: develop -> main#3681
Merged
Merged
Conversation
…k batch completion (#3680) * fix: stop buy-crypto transactions for blocked/deleted users to unblock batch completion When a user is deleted or blocked after their transaction enters a payout batch, the batch gets permanently stuck in PayingOut status. The blocked user check throws an error that is caught and silently continued, but the transaction never receives a payout order and can never complete. Since batch completion requires ALL transactions to have isComplete=true, one stuck transaction blocks the entire batch indefinitely. The per-asset batch lock then prevents any new batches for the same output asset from being created. Changes: - Add stop() method to BuyCrypto entity (sets STOPPED + isComplete) - In payoutTransactions(): stop blocked/deleted user transactions instead of throwing, preventing the dead-end from being created - In checkCompletion(): detect and stop blocked/deleted user transactions to unblock existing stuck batches * fix: do not set isComplete for stopped transactions, fix batch completion check isComplete should only be true when the payout is confirmed on-chain. The batch completion check now also accepts STOPPED transactions, so stopped transactions no longer block batch progression. * refactor: use entity stop() method in transaction service for consistency The existing manual stop in transaction.service.ts set the status directly instead of using the entity method pattern. Use the new stop() method for a single source of truth. * fix: set amlCheck to Fail for blocked/deleted users to trigger chargeback When a user is blocked or deleted, the money must be returned via the existing chargeback process. Set amlCheck=Fail with the appropriate AmlReason (USER_BLOCKED, USER_DATA_BLOCKED, or USER_DELETED). Buy-crypto: stop() now accepts optional amlReason parameter. Fiat-output: set amlCheck=Fail on linked BuyFiat entities for blocked users instead of throwing, triggering the sell-crypto chargeback flow. * test: add BuyFiatRepository mock to fiat-output-job test module * fix: use UserStatus enum instead of string literal, consistent reason in fiat-output
TaprootFreak
previously approved these changes
May 7, 2026
davidleomay
previously approved these changes
May 7, 2026
* feat: custody equity methods * fix: format * chore: refactoring * chore: more refactoring * chore: cleanup * fix: format * chore: PR review * chore: refactoring
* feat: fixed balance check + calculation, added order history API * fix: format * fix: required user role * feat: improved rounding * chore: after merge fixes
* fix: add missing fee and amount fallbacks * fix: store asset for receive
* feat: added rounding * fix: load relations * fix: format * fix: add from address * chore: cleanup
* [NOTASK] Fix onboarding pdf file bug * [NOTASK] Refactoring
davidleomay
approved these changes
May 11, 2026
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.
Automatic Release PR
This PR was automatically created after changes were pushed to develop.
Commits: 1 new commit(s)
Checklist