Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Why this matters
useBorrowerLoans uses queryKeys.borrowerLoans.byAddress -> [borrowerLoans, addr] (useApi.ts:1187) while useBorrowerLoansPage uses queryKeys.loans.borrowerPage -> [loans,borrower,addr,params] (useApi.ts:1221). These are disjoint prefixes. useCreateLoan invalidates only [loans] (useApi.ts:870) -> hits borrowerPage but misses byAddress; useRepayLoan (useApi.ts:1557) and useLoanStream (useLoanStream.ts:43) invalidate only byAddress -> miss the paginated borrowerPage list. Result: after creating/repaying, one of the two borrower lists shows stale data until staleTime expires.
Acceptance criteria
Files to touch
frontend/src/app/hooks/useApi.ts
frontend/src/app/hooks/useLoanStream.ts
Out of scope
Why this matters
useBorrowerLoans uses queryKeys.borrowerLoans.byAddress -> [borrowerLoans, addr] (useApi.ts:1187) while useBorrowerLoansPage uses queryKeys.loans.borrowerPage -> [loans,borrower,addr,params] (useApi.ts:1221). These are disjoint prefixes. useCreateLoan invalidates only [loans] (useApi.ts:870) -> hits borrowerPage but misses byAddress; useRepayLoan (useApi.ts:1557) and useLoanStream (useLoanStream.ts:43) invalidate only byAddress -> miss the paginated borrowerPage list. Result: after creating/repaying, one of the two borrower lists shows stale data until staleTime expires.
Acceptance criteria
Files to touch
frontend/src/app/hooks/useApi.tsfrontend/src/app/hooks/useLoanStream.tsOut of scope