From 4db68c7f7d3373b6c8927ef5dd5819d40fbadd5d Mon Sep 17 00:00:00 2001 From: Louis Chmn Date: Thu, 25 Jun 2026 13:59:50 +0200 Subject: [PATCH 1/2] fix: Update display name in User object This is breaking other consumers of the user object as they will use the old display name. This was an issue in Talk where they cache the display names. Signed-off-by: Louis Chmn --- lib/UserBackend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/UserBackend.php b/lib/UserBackend.php index 4110bcddc..ac07114ec 100644 --- a/lib/UserBackend.php +++ b/lib/UserBackend.php @@ -541,7 +541,7 @@ public function updateAttributes(string $uid): void { $currentDisplayname = $this->getDisplayName($uid); if ($newDisplayname !== null && $currentDisplayname !== $newDisplayname) { - $this->setDisplayName($uid, $newDisplayname); + $user->setDisplayName($newDisplayname); $this->logger->debug('Display name updated', ['app' => 'user_saml', 'user' => $user->getUID()]); $this->eventDispatcher->dispatchTyped(new UserChangedEvent($user, 'displayName', $newDisplayname, $currentDisplayname)); $this->logger->debug('Display name update event dispatched', ['app' => 'user_saml', 'user' => $user->getUID()]); From 836101454900ef71f785949c7f8a2498c0ffedfa Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 29 Jun 2026 15:46:22 +0200 Subject: [PATCH 2/2] fix(tests): Adapt unit tests Signed-off-by: Carl Schwan --- tests/unit/UserBackendTest.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/unit/UserBackendTest.php b/tests/unit/UserBackendTest.php index 3ab06a72e..e91a37c8f 100644 --- a/tests/unit/UserBackendTest.php +++ b/tests/unit/UserBackendTest.php @@ -289,10 +289,9 @@ public function testUpdateAttributes(): void { ->method('getDisplayName') ->with('ExistingUser') ->willReturn(''); - $this->userBackend - ->expects($this->once()) + $user->expects($this->once()) ->method('setDisplayName') - ->with('ExistingUser', 'New Displayname'); + ->with('New Displayname'); $this->groupManager ->expects($this->once()) ->method('handleIncomingGroups') @@ -343,10 +342,9 @@ public function testUpdateAttributesQuotaDefaultFallback(): void { ->method('getDisplayName') ->with('ExistingUser') ->willReturn(''); - $this->userBackend - ->expects($this->once()) + $user->expects($this->once()) ->method('setDisplayName') - ->with('ExistingUser', 'New Displayname'); + ->with('New Displayname'); $this->eventDispatcher->expects($this->once()) ->method('dispatchTyped') ->with(new UserChangedEvent($user, 'displayName', 'New Displayname', ''));