nextcloud / nextcloud/server

Migrate `\OC\User::assignedUserId` to `EventDispatcher` and execute in the background

Open
#28,983 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement feature: ldap performance 🚀 technical debt
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

  1. The event (and preUnassignedUserId and postUnassignedUserId) is not migrated to EventDispatcher yet
  2. user_ldap should dispatch it as background job
  3. guests should then use EventDispatcher, too
  4. check other apps?

Background for 2) because the event is emitted early while the user is not fully processed yet, it lead's to at least one additional ldap_read operation/user. This can be saved when doing it afterwards as the display name will be cached by then. This might save some DB requests. It should be clarified whether there are any conflicts with IUsers::triggerChange(), which will also happen during user update (but slightly later).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace OC\User::assignedUserId and the preUnassignedUserId/postUnassignedUserId events, then inspect the user_ldap and guests integrations around EventDispatcher. Clarify the interaction with IUsers::triggerChange() before changing behavior. Done means the listed event migrations, background dispatch for user_ldap, EventDispatcher use by guests, and checks of other apps are complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.