Loading patches/025-optimize-get-by-email.patch +5 −5 Original line number Diff line number Diff line Loading @@ -2,9 +2,9 @@ From: Akhil <akhil@e.email> Date: Tue, 10 Mar 2023 10:00 +0530 Subject: [PATCH] To optimize getByEmail as we have boundary conditions that email is unique per-user and can only match one of the two domains --- ./lib/private/User/Manager.php 2023-05-05 18:29:34.818568291 +0530 +++ ./lib/private/User/Manager-new.php 2023-05-05 18:33:49.872682118 +0530 @@ -653,12 +653,33 @@ --- ./lib/private/User/Manager.php 2026-03-23 17:46:39.585001447 +0600 +++ ./lib/private/User/Manager-new.php 2026-03-24 11:07:50.268010574 +0600 @@ -671,11 +671,33 @@ */ public function getByEmail($email) { // looking for 'email' only (and not primary_mail) is intentional Loading @@ -18,7 +18,7 @@ Subject: [PATCH] To optimize getByEmail as we have boundary conditions that emai - }, $userIds); + if(empty($legacyDomain) && empty($mainDomain)) { + $userIds = $this->config->getUsersForUserValueCaseInsensitive('settings', 'email', $email); + + $users = array_map(function ($uid) { + return $this->get($uid); + }, $userIds); Loading @@ -39,6 +39,6 @@ Subject: [PATCH] To optimize getByEmail as we have boundary conditions that emai + $users = [$this->get($uid)]; + } + } return array_values(array_filter($users, function ($u) { return ($u instanceof IUser); })); Loading
patches/025-optimize-get-by-email.patch +5 −5 Original line number Diff line number Diff line Loading @@ -2,9 +2,9 @@ From: Akhil <akhil@e.email> Date: Tue, 10 Mar 2023 10:00 +0530 Subject: [PATCH] To optimize getByEmail as we have boundary conditions that email is unique per-user and can only match one of the two domains --- ./lib/private/User/Manager.php 2023-05-05 18:29:34.818568291 +0530 +++ ./lib/private/User/Manager-new.php 2023-05-05 18:33:49.872682118 +0530 @@ -653,12 +653,33 @@ --- ./lib/private/User/Manager.php 2026-03-23 17:46:39.585001447 +0600 +++ ./lib/private/User/Manager-new.php 2026-03-24 11:07:50.268010574 +0600 @@ -671,11 +671,33 @@ */ public function getByEmail($email) { // looking for 'email' only (and not primary_mail) is intentional Loading @@ -18,7 +18,7 @@ Subject: [PATCH] To optimize getByEmail as we have boundary conditions that emai - }, $userIds); + if(empty($legacyDomain) && empty($mainDomain)) { + $userIds = $this->config->getUsersForUserValueCaseInsensitive('settings', 'email', $email); + + $users = array_map(function ($uid) { + return $this->get($uid); + }, $userIds); Loading @@ -39,6 +39,6 @@ Subject: [PATCH] To optimize getByEmail as we have boundary conditions that emai + $users = [$this->get($uid)]; + } + } return array_values(array_filter($users, function ($u) { return ($u instanceof IUser); }));