microsoftgraph / microsoftgraph/msgraph-beta-sdk-java

User::getProfile retrieves null when it shouldn't

Aberta
#1,256 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

type:bug
Linguagem predominante
Java
Estrelas
32
Forks
14
Merge médio
1d 3h
PRs com merge (30d)
6

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece reproduzindo o fluxo de transitiveMembers() e inspecione User::getProfile() para os usuários retornados por essa cadeia. Compare-o com graphClient.users().byUserId(user.getId()).profile().get(); considera-se concluído quando o acesso direto ao perfil de User retorna o perfil existente no cenário relatado.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
java
Domínio
api
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.