From 1e9919f9aeba1dfd86efb0d5e3a42aa0fd1cdd9b Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Tue, 15 Jul 2025 18:28:20 +0200 Subject: [PATCH 1/2] fix: Fix space root handling in a graph sharedByMe The drive item name was derived from the resource path. Space roots have no path ("."), so e.g. the sharedByMe response reported "." as the name of a shared project space. Use the name provided by the storage provider and fall back to the base of the path if it is empty. Adjust the sharedByMe acceptance scenario for link shares of a project space accordingly: the space root item now carries the name of the space. --- services/graph/pkg/service/v0/driveitems.go | 7 +++++-- tests/acceptance/features/apiSharingNg1/sharedByMe.feature | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/services/graph/pkg/service/v0/driveitems.go b/services/graph/pkg/service/v0/driveitems.go index 88ba754796..f1ea215b0e 100644 --- a/services/graph/pkg/service/v0/driveitems.go +++ b/services/graph/pkg/service/v0/driveitems.go @@ -513,9 +513,12 @@ func cs3ResourceToDriveItem(logger *log.Logger, publicBaseURL *url.URL, res *sto webURL.Path = path.Join(webURL.Path, "f", storagespace.FormatResourceID(res.GetId())) driveItem.WebUrl = libregraph.PtrString(webURL.String()) - if name := path.Base(res.GetPath()); name != "" { - driveItem.Name = &name + name := res.GetName() + if name == "" { + name = path.Base(res.GetPath()) } + driveItem.Name = &name + if res.GetEtag() != "" { driveItem.ETag = &res.Etag } diff --git a/tests/acceptance/features/apiSharingNg1/sharedByMe.feature b/tests/acceptance/features/apiSharingNg1/sharedByMe.feature index 1223b03c23..83dc98a12e 100644 --- a/tests/acceptance/features/apiSharingNg1/sharedByMe.feature +++ b/tests/acceptance/features/apiSharingNg1/sharedByMe.feature @@ -3378,7 +3378,6 @@ Feature: resources shared by user } """ - @issue-8355 Scenario: sharer lists the link share of a project space Given using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API @@ -3413,7 +3412,7 @@ Feature: resources shared by user ], "properties": { "name": { - "const": "." + "const": "NewSpace" }, "root": { "const": {} From 25534bb0109692ebac068bf4a48bf3f448ad6043 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 10 Nov 2026 14:38:07 +0100 Subject: [PATCH 2/2] test(acceptance): add missing blank line before scenario in sharedByMe.feature --- tests/acceptance/features/apiSharingNg1/sharedByMe.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/acceptance/features/apiSharingNg1/sharedByMe.feature b/tests/acceptance/features/apiSharingNg1/sharedByMe.feature index 83dc98a12e..782cd63ebf 100644 --- a/tests/acceptance/features/apiSharingNg1/sharedByMe.feature +++ b/tests/acceptance/features/apiSharingNg1/sharedByMe.feature @@ -3378,6 +3378,7 @@ Feature: resources shared by user } """ + Scenario: sharer lists the link share of a project space Given using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API