Skip to content

Add stale data handling and cache invalidation rules #30

@Lakes41

Description

@Lakes41

Summary

Define a consistent caching and invalidation strategy for dashboard data so pages do not show stale members, passes, guilds, or activity after mutations.

Current Behaviour

Static mock data is imported directly and there is no cache lifecycle. Once live mode or mock persistence is added, the dashboard needs predictable invalidation behaviour.

Expected Behaviour

Data reads and mutations should use a shared cache strategy that refreshes affected entities after create, edit, role assignment, verification, or webhook updates.

Suggested Implementation

Introduce a query/cache layer using the project's chosen client-side state approach. Define stable query keys for guilds, passes, members, activity, and settings. Invalidate or update relevant keys after mutations.

Files or Areas Likely Affected

  • apps/dashboard/lib/data/
  • apps/dashboard/lib/cache/
  • apps/dashboard/app/passes/page.tsx
  • apps/dashboard/app/members/page.tsx
  • apps/dashboard/app/activity/page.tsx
  • apps/dashboard/components/

Acceptance Criteria

  • Stable cache keys exist for major dashboard entities
  • Pass create and edit flows refresh pass lists
  • Member role updates refresh member and activity views
  • Guild context changes do not reuse stale data from another guild
  • Error states do not overwrite previously valid cached data unexpectedly
  • Tests or documented scenarios cover cache invalidation paths

Additional Notes

Assumption: this can be implemented with React Query, SWR, or a project-approved equivalent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

    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