Repoint account primary wallet so merge mail is delivered#3843
Merged
Conversation
davidleomay
approved these changes
Jun 9, 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.
Summary
Data-only migration that re-points one account's primary
user_data.walletIdfrom a wallet that disables theInfomail type to the defaultDFX Wallet(id 1,mailConfig = NULL).This unblocks the account-merge confirmation mail for that account:
ACCOUNT_MERGE_REQUESTis classified asMailContextType.INFO, and the account's primary wallet hadInfoin itsmailConfig, so the mail was silently suppressed (mail.factory.tsisDisabledMailWallet→createMailreturnsundefined→notification.service.ts:26sendMailreturns without persisting). After re-pointing,resolveMailWallet(notification.service.ts:135) falls back to the default wallet (noInfoopt-out) and the mail is delivered.This PR is a targeted data fix only. The systemic bug (mandatory merge mail being suppressible because it lives in the
Infobucket) is documented separately in #3842 and intentionally not fixed here.Details
migration/1780993625289-RepointAccountWalletForMergeMail.js, hand-written in the style of the existing data migration1779381590531-RouteScryptEurViaUsdt.js.up()only acts when the row is in the expected pre-state (walletId = 67); it is a no-op on environments where the row/state differs.down()reverses it with a symmetric guard.migration-psql-checkguard test.Tradeoff
user_data.walletalso influences fee verification (fee.service.ts:201), auto-trade-approval (auth.service.ts:423) and mail branding. Re-pointing to the default wallet changes these bindings for this account — accepted as the intended outcome.PR completeness
Test plan
npx jest migration-psql-checkpasses (PostgreSQL compatibility)npm run type-checkpassesRelates to #3842