Skip to content

fix: omit unsupported $top query option on chat members list#28

Open
amanjoshicodes wants to merge 1 commit into
osodevops:mainfrom
amanjoshicodes:fix/chat-members-top
Open

fix: omit unsupported $top query option on chat members list#28
amanjoshicodes wants to merge 1 commit into
osodevops:mainfrom
amanjoshicodes:fix/chat-members-top

Conversation

@amanjoshicodes

Copy link
Copy Markdown
Contributor

Fixes #27.

teams chat members list <chat-id> failed with HTTP 400 because chats::list_members appended $top to GET /chats/{id}/members, which doesn't support OData query parameters. Microsoft Graph rejects the request with Query option 'Top' is not allowed.

This routes list_members through the existing GraphClient::get_paged_without_top — added in #24 for the same class of bug on list_channels — so the request pages via @odata.nextLink without $top.

Changes

  • chats::list_members now delegates to a private list_members_at(url, ...) helper that calls get_paged_without_top, mirroring the list_channels / list_channels_at shape introduced in Fix channel list pagination query #24.
  • Adds a wiremock unit test list_members_omits_top_query_parameter asserting the outgoing request carries no $top (matches the list_channels_omits_top_query_parameter test).

Verification

  • cargo fmt --all, cargo clippy --all-targets -- -D warnings, cargo test --all-targets — all green (76 unit + 44 integration).
  • Live against a real group chat: teams chat members list <chat-id> now returns members instead of a 400.

Scope is intentionally limited to chat members. Team members and channel members both document $top support, so they're unchanged.

@sionsmith

Copy link
Copy Markdown
Contributor

Firstly thank you @amanjoshicodes - we will check this today / tomorrow 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chat members list fails with HTTP 400: $top not supported on /chats/{id}/members

2 participants