microsoftgraph / microsoftgraph/msgraph-sdk-java

Fetching allMembers fails for public and private channels

Open
#2,438 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:waiting-for-triage type:bug
Dominant language
Java
Stars
444
Forks
154
Avg merge
18h 28m
Merged PRs (30d)
4

Description

Describe the bug

According to the documentation the allMembers endpoint can be used for any channel type. This can be confirmed using the Graph Explorer or manualy invoking that endpoint.

However, when using the SDK to fetch all members for any channel that is not shared the request fails.

com.microsoft.graph.models.odataerrors.ODataError: Failed to execute GetThreadRosterAsync.
	at com.microsoft.graph.models.odataerrors.ODataError.createFromDiscriminatorValue(ODataError.java:36)
	at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:212)
	at com.microsoft.kiota.http.OkHttpRequestAdapter.lambda$throwIfFailedResponse$0(OkHttpRequestAdapter.java:706)
	at com.microsoft.kiota.ApiExceptionBuilder.<init>(ApiExceptionBuilder.java:26)
	at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:705)
	at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:307)
	at com.microsoft.graph.teams.item.channels.item.allmembers.AllMembersRequestBuilder.get(AllMembersRequestBuilder.java:102)
	at com.microsoft.graph.teams.item.channels.item.allmembers.AllMembersRequestBuilder.get(AllMembersRequestBuilder.java:88)
...
Expected behavior

The request should work for any channel type (as it does when using the members() endpoint insted of allMembers().

How to reproduce
graphClient.teams()
    .byTeamId(team.getId())
    .channels()
    .byChannelId(channel.getId()) //use a private or public channel here
    .allMembers()
    .get(); //the error occurs at this point unless the provided channel has MembershipType.Shared
SDK Version

6.45.0

Latest version known to work for scenario above?

No response

Known Workarounds

Check the Channel.getMembershipType() and fallback to members() if the channel is not shared

Debug output

No response

Configuration

No response

Other information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Java reproduction in the issue and inspect AllMembersRequestBuilder.get, then compare the generated allMembers and members request paths for public, private, and shared channels. Confirm the behavior against the documented allMembers endpoint and determine whether the discrepancy is in the SDK request or the service; done means the failing channel types are handled consistently or the issue is clearly identified as service-side.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.