Summary
Two related correctness problems in useTransactionHistory's caching/memoization:
- Cache key ignores filters. The cache key is
`${publicKey}-${page}` (line 42) but results are filtered by options.assetCodes/issuer/contractIds in parseOperation. Changing filters returns stale cached rows for a different filter set.
- Unstable
useCallback dependency. fetchTransactions lists options in its dependency array (line 67). options is an object literal recreated by the caller every render, so the callback identity changes every render, defeating memoization and risking redundant fetches.
Evidence
frontend/src/hooks/useTransactionHistory.ts:42, :67
Suggested fix
Include the serialized filter options in the cache key, and either memoize options at the call site or destructure its primitive fields into the dependency array.
Summary
Two related correctness problems in
useTransactionHistory's caching/memoization:`${publicKey}-${page}`(line 42) but results are filtered byoptions.assetCodes/issuer/contractIdsinparseOperation. Changing filters returns stale cached rows for a different filter set.useCallbackdependency.fetchTransactionslistsoptionsin its dependency array (line 67).optionsis an object literal recreated by the caller every render, so the callback identity changes every render, defeating memoization and risking redundant fetches.Evidence
frontend/src/hooks/useTransactionHistory.ts:42,:67Suggested fix
Include the serialized filter options in the cache key, and either memoize
optionsat the call site or destructure its primitive fields into the dependency array.