Quick resolve account types

This commit is contained in:
Brandon Li
2026-09-03 13:13:32 -05:00
parent 9d4e7a36a7
commit dece6999f0
2 changed files with 18 additions and 0 deletions
+18
View File
@@ -163,6 +163,24 @@ export function resolveFirmAssignments(
break;
}
}
// Fallback while the throttled report fetch hasn't produced fund
// transactions yet: an account that has never traded still sits at
// exactly its opening balance, and balances arrive with the first
// sync. Only a cent-exact match counts — a traded account's balance
// won't equal any type size, so it falls through and waits for the
// reports as before. The matched size is persisted below, so the
// assignment survives once the balance starts moving.
if (!matched.type) {
const balance = client.accountCashBalances[account.id]?.amount;
if (typeof balance === 'number') {
const attempt = matchAccountType(account.name, balance, types);
if (attempt.type) {
matched = attempt;
matchedSize = balance;
}
}
}
}
if (matched.type) {