Skip to content

Public profile cache is never invalidated after platform link mutations, causing stale DevCard profiles #482

@Ridanshi

Description

@Ridanshi

Summary

The public profile cache is not invalidated when platform links are created, updated, deleted, or reordered.

As a result, users can successfully modify their profile links while visitors continue seeing stale data until the cache expires.

Affected Files

  • profileService.ts
  • publicService.ts

Root Cause

Public profile data is cached using a username-based cache key.

However, platform link mutation flows update the database without invalidating the corresponding cached profile entry.

The cache therefore continues serving outdated platform link information until the configured TTL expires.

Reproduction

  1. Open a public DevCard profile.
  2. Ensure the profile response is cached.
  3. Create, update, delete, or reorder a platform link.
  4. Immediately revisit the public profile.
  5. Observe that the old link state is still returned.
  6. Wait for cache expiration and observe that the updated state finally appears.

Expected Behavior

Profile mutations should invalidate the cached public profile immediately.

Visitors should always see the latest platform link configuration.

Actual Behavior

Stale profile data continues to be served until cache expiration.

Why This Is Difficult To Detect

Most tests validate database state immediately after mutations and do not execute through a warm cache layer.

The issue only appears when cached profile data already exists.

Production Impact

  • Deleted links remain visible
  • New links remain hidden
  • Reordered links appear incorrect
  • Public profile consistency is lost
  • User actions appear unsuccessful

Suggested Fix

Invalidate the corresponding public profile cache entry after all platform link mutations complete successfully.

Severity

High

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions