Skip to content

Activate an Implemented but Unused Read-Through Cache Decorator on Stellar Service Calls #1717

Description

@Emmyt24

Description

backend/src/stellar-service-integration/stellar-read-cache.ts and stellar-cache.decorator.ts implement a fully unit-tested read-through caching layer, but @CacheStellarRead is never applied to any method on StellarService (getTokenInfo, getFactoryState, getTransaction, etc.) — the caching layer is dead code and every read still hits the RPC directly.

Requirements and Context

  • Apply the decorator only to genuinely cacheable, read-only methods
  • Confirm cache invalidation behaves correctly once the decorator is actually exercised by real call sites

Suggested Execution

Branch: feat/integration-activate-stellar-read-cache

Implement Changes

  • Apply @CacheStellarRead to the appropriate read-only methods on StellarService (getTokenInfo, getFactoryState, getTransaction)
  • Confirm the existing cache invalidation logic behaves correctly once real call sites are decorated
  • Add a test asserting a repeated call within the cache window doesn't re-hit the RPC client

Test and Commit

Run npx vitest run src/__tests__/stellarReadCache.integration.test.ts — a repeated read within the cache window is served from cache instead of re-hitting the RPC client.

Example Commit Message

feat(backend): apply the read-through cache decorator to stellar service read methods

Closes #<issue>

Guidelines

  • Branch from main, open a PR back to main
  • All new code must have corresponding tests
  • Run npm run lint and npm run test before pushing
  • Follow existing naming conventions and file structure
  • PR description must reference this issue number (e.g., Closes #<issue>)
  • Keep commits atomic and use conventional commit format

Metadata

Metadata

Assignees

No one assigned

    Labels

    integrationIntegration / external services

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions