Skip to content

bug: TransactionHistory cache key ignores filter options and useCallback dep is unstable #839

Description

@Ejirowebfi

Summary

Two related correctness problems in useTransactionHistory's caching/memoization:

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workingfrontend

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions