Skip to content

[Frontend] Several hooks bypass the queryKeys factory with ad-hoc inline keys, defeating centralized/typed invalidation #1222

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

The file ships a Centralised query key factory (useApi.ts:38) whose stated purpose is targeted invalidation, yet useCreditScore (useApi.ts:1044), useCreditScoreHistory (989), useYieldHistory (1153), useRemittanceNft (1013), useNotificationPreferences (1343), useLoanAmortizationSchedule (711) and useLoanAmortizationPreview (738) hardcode string-array keys outside the factory. These keys can drift from invalidators and there is no compile-time guarantee read/write keys agree.

Acceptance criteria

  • Add factory entries for creditScore, creditScoreHistory, yieldHistory, remittanceNft, notificationPreferences, amortization, amortizationPreview
  • Replace the inline keys in those hooks with the factory functions
  • Type queryKeys with as const return types already present so invalidators reuse them

Files to touch

  • frontend/src/app/hooks/useApi.ts

Out of scope

  • Renaming existing cache keys that would invalidate persisted caches

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestfrontendIssues related to frontend developmentoptimizationCode optimization

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