Skip to content

Hydrate persisted TanStack Query cache on client app boot #723

Description

@king-aj-the-first

GitHub labels: Stellar Wave

Drips complexity: High (200 points)

Area: Performance

Description

lib/queryPersistence.ts defines persistence helpers, but app/providers.tsx does not restore the dehydrated cache on first paint.

Requirements and Context

Returning users should see cached marketplace data instantly while revalidating. Wire persistQueryClient restore in Providers.

Suggested Execution

git checkout -b feat/query-persistence-hydration
  1. Create branch feat/query-persistence-hydration
  2. Integrate queryPersistence in app/providers.tsx
  3. Restore cache before rendering data routes
  4. Skip persistence for wallet/tx sensitive keys
  5. Add test for dehydrate/hydrate round-trip

Example commit message

feat(performance): hydrate persisted TanStack Query cache on boot

File Paths

  • lib/queryPersistence.ts
  • app/providers.tsx
  • lib/queryKeys.ts

Guidelines

  • Assignment required before starting
  • PR description must include: Closes #<issue_number>
  • Run npm run lint, npm run type-check, npm run test, and npm run build before opening PR
  • Add screenshots or recordings for UI changes
  • Complexity: High (200 points) — complex engineering work touching multiple modules

Acceptance Criteria

  • Cache restores on reload for marketplace queries
  • Wallet routes are excluded from persistence
  • Stale data revalidates in background
  • No hydration mismatch errors
  • Test covers round-trip

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