Description
Two compounding reliability gaps:
-
Silent mock fallback with no retry. pages/api/profile.ts and pages/api/usdc-price.ts fall back to hardcoded mock data on any fetch failure (network error, non-2xx, bad JSON), with no retry/backoff, and the source: 'mock' | 'backend' field they already compute is never surfaced in the UI — so users can't tell if they're looking at real or fake data. There's no evidence a real PROFILE_API_BASE_URL backend is deployed yet.
-
Fragile, single-wallet connection model. hooks/useAccount.ts polls Freighter via an un-backed-off setInterval(syncAccount, 2000) that never pauses on tab blur and never surfaces errors to the UI. components/atoms/wallet-button/index.tsx's "Switch account" just re-invokes setAllowed() without verifying the address actually changed. Freighter is the only supported wallet.
Component
Frontend
Difficulty
🟣 Spike — investigation required, scope not yet defined
Tasks
Acceptance Criteria
Estimated Time
1-2 days (time-boxed spike)
Description
Two compounding reliability gaps:
Silent mock fallback with no retry.
pages/api/profile.tsandpages/api/usdc-price.tsfall back to hardcoded mock data on any fetch failure (network error, non-2xx, bad JSON), with no retry/backoff, and thesource: 'mock' | 'backend'field they already compute is never surfaced in the UI — so users can't tell if they're looking at real or fake data. There's no evidence a realPROFILE_API_BASE_URLbackend is deployed yet.Fragile, single-wallet connection model.
hooks/useAccount.tspolls Freighter via an un-backed-offsetInterval(syncAccount, 2000)that never pauses on tab blur and never surfaces errors to the UI.components/atoms/wallet-button/index.tsx's "Switch account" just re-invokessetAllowed()without verifying the address actually changed. Freighter is the only supported wallet.Component
Frontend
Difficulty
🟣 Spike — investigation required, scope not yet defined
Tasks
/profileand/usdc-price(or equivalent) against the actualtrustflow-backendendpointsuseAccount.tsAcceptance Criteria
Estimated Time
1-2 days (time-boxed spike)