Automatically assign user cache contexts/tags when using current_user service

Created on 27 August 2015, almost 10 years ago
Updated 16 May 2025, 22 days ago

Problem/Motivation

It's easy to forget the user cache context when doing stuff based on the current user.

Proposed resolution

Add the cache context and tag automatically whenever any user-specific data is accessed on the current_user service.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

📌 Task
Status

Postponed

Version

11.0 🔥

Component

cache system

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Security improvements

    It makes Drupal less vulnerable to abuse or misuse. Note, this is the preferred tag, though the Security tag has a large body of issues tagged to it. Do NOT publicly disclose security vulnerabilities; contact the security team instead. Anyone (whether security team or not) can apply this tag to security improvements that do not directly present a vulnerability e.g. hardening an API to add filtering to reduce a common mistake in contributed modules.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024