Teams bridge fetches each channel's description from Graph and never uses it

Open Beginner friendly
#2,162 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
85/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Open bridges/collaboration/teams/graph.py and find the $select in TeamsGraphClient.get_channel; confirm nothing in bridges/collaboration/teams/adapter.py or elsewhere in the bridge reads channel.get("description"). Then remove description from the $select list, keeping the comment about email/summary/layoutType intact, and check the Microsoft Teams docs page that lists Channel.ReadBasic.All scopes so the documented field list matches. Done means the per-channel request asks for four fields and the Teams bridge tests still pass.

Written by the indexing model from the issue text.

Description

Summary

The Teams bridge asks Microsoft Graph for each channel's description and never uses it. It is fetched on every per-channel read and discarded.

Verified at switch-v0.32.1.

Detail

TeamsGraphClient.get_channel selects five fields (bridges/collaboration/teams/graph.py):

params={"$select": "id,displayName,description,membershipType,layoutType"},

The callers keep three of them — displayName into _channel_names, membershipType via _channel_type_of, layoutType into _channel_layouts (adapter.py, around the two _channel_layouts[channel_id] = ... assignments). description is read from Graph and dropped: there is no channel.get("description") anywhere in the bridge.

The $select is deliberate and well commented — it exists to avoid Graph populating the expensive email and summary fields, and because layoutType is only returned by the per-channel read. description looks like it was included for symmetry rather than for a consumer.

Why it is worth fixing

Small, but it is customer-visible in the wrong way: the Microsoft Teams page documents Channel.ReadBasic.All by telling an administrator what Switch reads from a channel. An admin reviewing the grant, or a privacy reviewer reading that page, is entitled to expect the list to be complete. Right now the honest list is four fields, one of which Switch has no use for.

Fetching and discarding a free-text field that users write into is unnecessary collection, and it makes the documentation either incomplete or awkward.

Suggested fix

Drop description from the $select, so what Switch reads matches what it uses — and what the page says.

Dominant language
Python
Stars
4.5k
Forks
348
Avg merge
1d 17h
Merged PRs (30d)
287

Getting set up

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.

More from sandbox-quantum/switch

All issues in sandbox-quantum/switch

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.