microsoftgraph / microsoftgraph/msgraph-beta-sdk-java
User::getProfile retrieves null when it shouldn't
Nadie ha tomado este issue todavía.
- 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:
- getting Users as transitiveMembers of a group
UserCollectionResponse userResult = graphClient.groups() .byGroupId(groupId) .transitiveMembers() .graphUser() .get(); - iterate over all users
userResult.getValue().forEach(this::getProfile); - 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
- getting Users as transitiveMembers of a group
UserCollectionResponse userResult = graphClient.groups() .byGroupId(groupId) .transitiveMembers() .graphUser() .get(); - iterate over all users
userResult.getValue().forEach(this::getProfile); - 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
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- 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