whisper-money/app/Services/Banking
Víctor Falcón 64b78e3680
fix(banking): handle balance-fetch timeouts and silence handled retries (#450)
Fixes two linked production banking-sync issues.

## PHP-LARAVEL-W — `cURL error 28: timed out` in
`EnableBankingProvider::getBalances` (8 events, 4 users, High)

`getBalances` called `$response->throw()` raw, so a connection timeout
(or ASPSP error) escaped as an **unhandled**
`ConnectionException`/`RequestException` and crashed the sync.
`getTransactions` already wraps these in
`TransientBankingProviderException` (which `implements ShouldntReport`
and is handled as a transient, retryable error in
`SyncBankingConnectionJob`).

→ `getBalances` now follows the exact same pattern. Genuine validation
errors (non-ASPSP 4xx) stay reportable.

## PHP-LARAVEL-2D — `SyncBankingConnectionJob has been attempted too
many times` (High, regressed)

The hanging balance call above pushed the job past its 120s `timeout`,
the worker was killed mid-job, and the retry tripped a
`MaxAttemptsExceededException`. That exception is thrown by the queue
worker (not catchable in `handle()`), and the job's `failed()` handler
**already** records the terminal `Error` state on the connection — so
the Sentry report is redundant operational noise.

→ Fixing W removes the main cause of the timeout. Additionally,
`MaxAttemptsExceededException` is no longer reported **for this job
only** (scoped via `dontReportWhen` on `$e->job?->resolveName()`); other
jobs still report it.

## Tests
- `getBalances` wraps connection failures and ASPSP errors as
non-reportable transient errors; keeps non-ASPSP client errors
reportable.
- `MaxAttemptsExceededException` is not reported for
`SyncBankingConnectionJob`, but still reported for other jobs.

Fixes PHP-LARAVEL-W, PHP-LARAVEL-2D.
2026-05-29 14:58:38 +02:00
..
Formatters feat: Add per-bank description formatter for bank-synced transactions (#120) 2026-02-13 09:54:58 +01:00
BalanceSyncService.php Batch historical balance writes (#356) 2026-05-05 15:26:28 +01:00
BinanceBalanceSyncService.php feat: store invested_amount in user currency instead of account currency (#262) 2026-04-06 12:48:13 +02:00
BinanceClient.php fix(static-analysis): clear phpstan-baseline by fixing all suppressed errors (#183) 2026-03-02 12:22:30 +00:00
BitpandaBalanceSyncService.php feat: store invested_amount in user currency instead of account currency (#262) 2026-04-06 12:48:13 +02:00
BitpandaClient.php fix(static-analysis): clear phpstan-baseline by fixing all suppressed errors (#183) 2026-03-02 12:22:30 +00:00
CoinbaseBalanceSyncService.php Backfill Coinbase monthly history (#395) 2026-05-14 10:52:46 +01:00
CoinbaseClient.php Backfill Coinbase monthly history (#395) 2026-05-14 10:52:46 +01:00
EnableBankingProvider.php fix(banking): handle balance-fetch timeouts and silence handled retries (#450) 2026-05-29 14:58:38 +02:00
IndexaCapitalBalanceSyncService.php feat: store invested_amount in user currency instead of account currency (#262) 2026-04-06 12:48:13 +02:00
IndexaCapitalClient.php fix(banking): treat Indexa Capital performance 404 as empty data (#386) 2026-05-13 09:34:28 +01:00
TransactionCounterpartyExtractor.php feat(transactions): add counterparty fields (#440) 2026-05-27 16:20:55 +02:00
TransactionDescriptionFormatter.php feat: Add per-bank description formatter for bank-synced transactions (#120) 2026-02-13 09:54:58 +01:00
TransactionFingerprint.php fix(banking): dedup EnableBanking transactions by deterministic fingerprint (#390) 2026-05-13 11:30:11 +01:00
TransactionSyncService.php feat(transactions): add counterparty fields (#440) 2026-05-27 16:20:55 +02:00