Skip to content

Cached public profiles lose viewer-specific follow state and display incorrect follow status #483

@Ridanshi

Description

@Ridanshi

Summary

Viewer-specific follow state is lost when a public profile is served from cache.

Authenticated users can see incorrect follow status even though the underlying follow records are correct.

Affected Files

  • publicService.ts

Root Cause

The public profile cache stores profile data that includes follow-state information.

When a cache hit occurs, the cached object is returned directly without recalculating viewer-specific follow relationships.

As a result, all viewers receive the same cached follow state regardless of their own follow history.

Reproduction

  1. Authenticate as a user.
  2. Visit another user's public profile.
  3. Follow one of the profile links.
  4. Refresh the profile while the cache remains warm.
  5. Observe that the follow status does not reflect the actual follow relationship.

Expected Behavior

Viewer-specific follow state should be computed for every authenticated request.

Actual Behavior

Cached responses contain stale or incorrect follow-state information.

Why This Is Difficult To Detect

Most tests focus on profile retrieval and follow functionality separately.

The issue only appears when authentication and profile caching interact simultaneously.

Production Impact

  • Incorrect follow indicators
  • Duplicate follow attempts
  • Confusing user experience
  • Inconsistent state across devices and tabs

Suggested Fix

Cache only shared profile data and compute viewer-specific follow state separately on every request.

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