Auto-assign BitcoinDepot referral on wallet detection#6022
Closed
j0ntz wants to merge 1 commit into
Closed
Conversation
Detect BitcoinDepot whitelabel users at login by checking account wallets for the BitcoinDepot login appId, and assign the bitcoindepot referral/affiliate ID to unaffiliated accounts. Existing affiliations are never overwritten.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Contributor
Author
|
Not possible to detect bd users |
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.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
Description
Asana task: https://app.asana.com/0/1215088146871429/1214990791228138
Detect BitcoinDepot whitelabel users at login by examining the account's wallets and auto-assign them the
bitcoindepotreferral/affiliate ID.hasBitcoinDepotWallets(account)(src/util/bitcoinDepotUtils.ts): true when any non-deleted wallet'sappIdscontains a BitcoinDepot appId (case-insensitive substring match, single updatable constant).loadAccountReferralassignsinstallerId: 'bitcoindepot'to unaffiliated accounts on both load paths (existing referral file withoutinstallerId, and the no-referral default path), persists it via the existingsaveAccountReferralflow, and attemptsactivatePromotion('bitcoindepot')with silent errors.installerIdalready set) are never overwritten.Note: the exact BitcoinDepot login appId is not present in this repo; the substring match constant should be confirmed/adjusted once the whitelabel appId is verified.
Note
Medium Risk
Changes login-time referral and promotion activation for a subset of users; mis-detection from the substring
appIdsmatch could affiliate wrong accounts, though existinginstallerIdvalues are preserved.Overview
Adds automatic BitcoinDepot whitelabel affiliation at login when wallet history indicates the user came from that app and the account has no
installerIdyet.A new
hasBitcoinDepotWalletshelper scans non-deleted wallets for a case-insensitivebitcoindepotsubstring inappIds.loadAccountReferralsetsinstallerIdtobitcoindepot, persists via the existing save flow, and callsactivatePromotion('bitcoindepot')with errors ignored. The same logic applies on the existing-referral path (only wheninstallerIdis unset) and on the no-referral-file default path. Existing affiliations are never overwritten. Unit tests cover the detector; CHANGELOG is updated.Reviewed by Cursor Bugbot for commit 76a478e. Bugbot is set up for automated code reviews on this repo. Configure here.