Project

General

Profile

Actions

Bug #1624

open

Bridge Card Deposit Optimization

Added by haroon sajjad 4 days ago. Updated 4 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
04/13/2026
Due date:
% Done:

100%

Estimated time:

Description

The Problem
Lack of Uniqueness: The phone column lacked a database-level UNIQUE constraint, allowing duplicate user accounts to be created in the past.
Selective Card Deposit Flakiness: The Bridge-to-PayCrypto deposit flow was unreliable because card selection intent was sometimes lost during the webhook transition, or the system looked up the wrong ID type (Event ID vs Transfer ID).
The Solution

  1. ** Data Integrity (Migrations)**
    Enforced Integrity: Created a migration to add a UNIQUE constraint on the phone column. This prevents any future duplicates at the database level.
  2. Card Deposit Reliability (Selective Card Flow)
    Memory-Based Intent Tracking: Added cardSelectionStore.js to track user card choice in memory using the Bridge Transfer ID as a key.
    Priority Lookup Logic : Refactored PayCryptoDepositService.js to use a 3-tier lookup:
    Memory : Check the live selection store.
    Database : Check the deposit_transactions table.
    Fallback : Use Primary/Active card if no selection is found.
Actions

Also available in: Atom PDF