SDK returns site `name` inconsistently: sometimes same as `displayName` instead of correct value and sometimes the correct value
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Bắt đầu từ entry point graphClient.sites().get() và so sánh cách SDK biểu diễn hai response Microsoft Graph đã được ghi nhận, bao gồm name và isPersonalSite. Sử dụng các response list và search được báo cáo để xác định tính nhất quán mong đợi; được xem là hoàn tất khi SDK cung cấp các giá trị ổn định cho cả hai field hoặc ghi rõ một giới hạn upstream.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Doing different site lists returns different values in the name field.
Doing a search limited to a smaller set of sites returns the correct / expected value in the name field.
Doing a list of all sites returns the displayName in the name field.
Expected behavior
The SDK should return values in the name field consistently.
How to reproduce
- Return sites using this code:
graphClient.sites().get()
The return value in the MSGraph API response is:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"createdDateTime": "2025-03-31T16:03:30Z",
"id": "mytenant.sharepoint.com,d0536e25-0c9c-4a9c-b879-cefdc46dc82d,9f7ed8fa-4175-4a6c-80ae-2e19f19f5948",
"name": "Test Site Many Names Site Info Name",
"webUrl": "https://mytenant.sharepoint.com/sites/TestSiteManyNames",
"displayName": "Test Site Many Names Site Info Name",
"isPersonalSite": false,
"siteCollection": {
"hostname": "mytenant.sharepoint.com"
},
"root": {}
},
{
"createdDateTime": "2025-02-23T17:46:07Z",
"id": "mytenant.sharepoint.com,c65bebd0-1a50-4d31-8ef8-51d067f95ca8,00577abf-eccb-44ae-ba22-1542cc3249e3",
"name": "Apps",
"webUrl": "https://mytenant.sharepoint.com/sites/appcatalog",
"displayName": "Apps",
"isPersonalSite": false,
"siteCollection": {
"hostname": "mytenant.sharepoint.com"
},
"root": {}
},
{
"createdDateTime": "2025-02-20T01:38:39Z",
"id": "mytenant.sharepoint.com,09ed6654-3505-4561-a2e7-8d2776480abb,4d074863-0c38-46e8-b60a-156446947967",
"name": "Team Site",
"webUrl": "https://mytenant.sharepoint.com/sites/contentTypeHub",
"displayName": "Team Site",
"isPersonalSite": false,
"siteCollection": {
"hostname": "mytenant.sharepoint.com"
},
"root": {}
},
{
"createdDateTime": "2025-02-20T01:38:32Z",
"id": "mytenant.sharepoint.com,ff2ad436-8677-4cfb-91d6-67d7344474a0,9fda6e4f-a65f-4cc1-ba2b-3d11d30dccd7",
"webUrl": "https://mytenant.sharepoint.com/search",
"isPersonalSite": false,
"siteCollection": {
"hostname": "mytenant.sharepoint.com"
},
"root": {}
},
{
"createdDateTime": "2025-02-20T01:37:56Z",
"id": "mytenant-my.sharepoint.com,5a898f19-31d7-4f38-abd7-d7342535cb7d,6baab3c4-1e9a-4c52-bf5d-49f46471726d",
"name": "My Name",
"webUrl": "https://mytenant-my.sharepoint.com/personal/myid_mytenant_com",
"displayName": "My Name",
"isPersonalSite": true,
"siteCollection": {
"hostname": "mytenant-my.sharepoint.com"
},
"root": {}
},
{
"createdDateTime": "2025-02-20T01:35:31Z",
"id": "mytenant.sharepoint.com,e24ba8dd-ec64-4930-b9d3-6a4a542d4114,e69c54e0-3df2-4d80-a2f9-48f75cc5a825",
"name": "All Company",
"webUrl": "https://mytenant.sharepoint.com/sites/allcompany",
"displayName": "All Company",
"isPersonalSite": false,
"siteCollection": {
"hostname": "mytenant.sharepoint.com"
},
"root": {}
},
{
"createdDateTime": "2025-02-20T01:32:07Z",
"id": "mytenant.sharepoint.com,e3bb292d-6bce-419a-8f50-c98b996d3b34,965c6dcd-d66f-4f05-b23a-5274bd961199",
"name": "Communication site",
"webUrl": "https://mytenant.sharepoint.com/",
"displayName": "Communication site",
"isPersonalSite": false,
"siteCollection": {
"hostname": "mytenant.sharepoint.com"
},
"root": {}
}
]
}
- Return just one of the above sites, example here is the one with "Many" in the display name (Kotlin):
graphClient.sites().get {
it.queryParameters.search = "Many"
}
and the return value in the MSGraph API response is now:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"createdDateTime": "2025-03-31T16:03:30Z",
"description": "Test Site Many Names Description",
"id": "mytenant.sharepoint.com,d0536e25-0c9c-4a9c-b879-cefdc46dc82d,9f7ed8fa-4175-4a6c-80ae-2e19f19f5948",
"lastModifiedDateTime": "2025-03-31T16:03:38Z",
"name": "TestSiteManyNames",
"webUrl": "https://mytenant.sharepoint.com/sites/TestSiteManyNames",
"displayName": "Test Site Many Names Site Info Name",
"root": {},
"siteCollection": {
"hostname": "mytenant.sharepoint.com"
}
}
]
}
Note the difference in the Name fields. The first response contains "name": "Test Site Many Names Site Info Name" while the second response contains "name": "TestSiteManyNames".
Note also that the second response does not contain isPersonalSite: false (even if isPersonalSite is requested explicitly via $select).
SDK Version
6.33.0
Latest version known to work for scenario above?
No response
Known Workarounds
Extract the last path segment from the webUrl field to get the name consistently, after filtering out the root site.
Debug output
No response
Configuration
No response
Other information
No response
- Ngôn ngữ chính
- Java
- Star
- 447
- Fork
- 155
- Merge trung bình
- 23 giờ 41 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:waiting-for-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
microsoftgraph/msgraph-sdk-java#2678 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:waiting-for-triage type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:waiting-for-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Error in PATCH onlineMeetingĐang mởstatus:waiting-for-triage type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoftgraph/msgraph-sdk-java
Issue tương tự
-
Add support for PostgreSQL 19Đang mởcomponent/data-layer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
-
RegistryExceptionHandler uses self-referencing basePackageClasses instead of a controller classĐang mởbug finsim-registry good-first-issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
? - Needs Triage bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
NVIDIA/cudf-spark#17063 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
status:pending type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100