microsoftgraph / microsoftgraph/msgraph-beta-sdk-java

User::getProfile retrieves null when it shouldn't

Abierto
#1,256 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

type:bug
Lenguaje dominante
Java
Estrellas
32
Forks
14
Merge medio
1 d 3 h
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza reproduciendo el flujo de transitiveMembers() e inspecciona User::getProfile() para los usuarios devueltos por esa cadena. Compáralo con graphClient.users().byUserId(user.getId()).profile().get(); se considera terminado cuando el acceso directo al perfil de User devuelve el perfil existente en el escenario descrito.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
api
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.