Skip to content

Remove user memoization#2674

Open
Koc wants to merge 1 commit into
masterfrom
bugfix/fix-user-memoization
Open

Remove user memoization#2674
Koc wants to merge 1 commit into
masterfrom
bugfix/fix-user-memoization

Conversation

@Koc

@Koc Koc commented Jun 22, 2026

Copy link
Copy Markdown

User memoization in the Activity app causes incorrect activity notifications in edge cases, particularly when activities are generated about files changed by other users. This was observed in the Forms app.

Reproducer:

  1. Alice creates a form with submissions linked to file1.xlsx
  2. Bob creates a form with submissions linked to file2.xlsx
  3. Both forms are submitted quickly
  4. Wait for SyncSubmissionsWithLinkedFileJob to execute

Root cause:
The memoized user state persists across console commands and background jobs, even when the user context changes via:

$user = $this->userManager->get($ownerId);
$this->userSession->setUser($user);

Solution:
Remove user memoization at the Activity level since it's not needed and causes state leakage between different user contexts.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@Koc Koc force-pushed the bugfix/fix-user-memoization branch from 2bc0e8c to e5d2576 Compare June 22, 2026 21:55
@Koc Koc force-pushed the bugfix/fix-user-memoization branch 3 times, most recently from 00eb0dd to 105d42c Compare June 24, 2026 16:23
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc Koc force-pushed the bugfix/fix-user-memoization branch from 105d42c to 1673f42 Compare June 24, 2026 16:41
@Koc

Koc commented Jun 24, 2026

Copy link
Copy Markdown
Author

Psalm failures looks a bit unrelated... All other pipelines are green

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.

2 participants