Category: Frontend - Bug
Priority: Medium
Estimated Time: 30 minutes
Description:
In lib/api.ts, api.getWallet() and api.createWallet() are the only API calls that do not accept an AbortSignal. Every other call (getMe, getBalances, listTransactions, etc.) already threads through a signal. This inconsistency means any component that calls getWallet cannot cancel in-flight requests on unmount or navigation, causing potential state updates on unmounted components.
// lib/api.ts
getWallet: (token: string) => request<Wallet>('/wallet', { token }),
createWallet: (token: string) => request<Wallet>('/wallet/create', { method: 'POST', body: {}, token }),
Tasks:
- Add
signal?: AbortSignal to getWallet() and createWallet() in lib/api.ts
- Update
WalletPage to pass the signal from an AbortController in useEffect
- Add a test verifying abort cancels the request
Category: Frontend - Bug
Priority: Medium
Estimated Time: 30 minutes
Description:
In
lib/api.ts,api.getWallet()andapi.createWallet()are the only API calls that do not accept anAbortSignal. Every other call (getMe,getBalances,listTransactions, etc.) already threads through a signal. This inconsistency means any component that callsgetWalletcannot cancel in-flight requests on unmount or navigation, causing potential state updates on unmounted components.Tasks:
signal?: AbortSignaltogetWallet()andcreateWallet()inlib/api.tsWalletPageto pass the signal from anAbortControllerinuseEffect