Skip to content

fix(activity): compute mock activity timestamps dynamically at access time - #725

Open
dezzy-music wants to merge 1 commit into
MergeFi:mainfrom
dezzy-music:fix/mock-activity-dynamic-timestamps-707
Open

dezzy-music wants to merge 1 commit into
MergeFi:mainfrom
dezzy-music:fix/mock-activity-dynamic-timestamps-707

Conversation

@dezzy-music

Copy link
Copy Markdown

Summary

Fixes #707.

Mock activity events computed their timestamps using minutesAgo(n) once when mock-data.ts was initially loaded. On a long-running Next.js production server, the module remains loaded, causing the homepage's 'Live on the platform' feed to display events as hours or days stale.

Changes

  • Introduced getRecentActivity(now?: number) to compute timestamps dynamically relative to the current invocation time.
  • Provided a dynamic Proxy export for recentActivity to preserve seamless backwards-compatibility for existing call sites while ensuring all accesses receive fresh timestamps.
  • Added unit tests in mock-data.test.ts asserting relative timestamp accuracy and dynamic advancing over time.

Verification

  • Ran Jest: 8/8 tests pass in mock-data.test.ts.
  • Ran ESLint: 0 errors.

@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown

@dezzy-music is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mock activity timestamps are anchored at module load, so a long-running server shows the 'live' feed hours or days stale

1 participant