Skip to content

Add structured log for React Query cache hit on creator profile fetch with cache age #641

Description

@Chucks1093

Summary

When a creator profile is served from the React Query cache without a network request, there is no log recording the hit or how old the cached data is. A debug-level log on cache hit would help developers verify that caching is working as intended in production.

Scope

  • Add a query observer on the creator profile query that fires when data is returned from cache (isFetching: false and isStale: false immediately on mount)
  • Emit a debug-level log with fields: creator_id, cache_status: 'hit', data_age_ms (time since the query was last fetched)
  • Log must not fire when the query performs a network fetch
  • Log not emitted in the test environment

Acceptance Criteria

  • Log emitted on cache hit with all three fields
  • data_age_ms reflects time since last successful fetch
  • Log not emitted when a network fetch occurs
  • Log not emitted in test environment

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions