microsoftgraph / microsoftgraph/msgraph-beta-sdk-java

User::getProfile retrieves null when it shouldn't

Đang mở
#1,256 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

type:bug
Ngôn ngữ chính
Java
Star
32
Fork
14
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
6

Mô tả

Describe the bug

I'm trying to get all users in a group and after that getting the users profile.
While this won't work:

  1. getting Users as transitiveMembers of a group
    UserCollectionResponse userResult = graphClient.groups() .byGroupId(groupId) .transitiveMembers() .graphUser() .get();
  2. iterate over all users
    userResult.getValue().forEach(this::getProfile);
  3. call User::getProfile but it returns always null even when profile is existing and permissions are granted.
    private void getProfile(User user) { Profile profile = user.getProfile(); }

It will work when you do this instead of user.getProfile() in step 3:
private void getProfile(User user) { Profile profile = graphClient.users().byUserId(user.getId()).profile().get(); }
This returns the profile for me.

Expected behavior

when calling User::getProfile i expect to get the profile back instead of null.

How to reproduce
  1. getting Users as transitiveMembers of a group
    UserCollectionResponse userResult = graphClient.groups() .byGroupId(groupId) .transitiveMembers() .graphUser() .get();
  2. iterate over all users
    userResult.getValue().forEach(this::getProfile);
  3. call User::getProfile but it returns always null even when profile is existing and permissions are granted.
    private void getProfile(User user) { Profile profile = user.getProfile(); }
SDK Version

6.47.0

Latest version known to work for scenario above?

No response

Known Workarounds

Use:
graphClient.users().byUserId(user.getId()).profile().get();
instead of User::getProfile

Debug output
Configuration

No response

Other information

No response

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện luồng transitiveMembers() và kiểm tra User::getProfile() đối với các user được chuỗi đó trả về. So sánh với graphClient.users().byUserId(user.getId()).profile().get(); được coi là hoàn tất khi việc truy cập trực tiếp vào profile của User trả về profile hiện có trong kịch bản được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.