Skip to content

Rename IncomingFile.web_url to content_url - #580

Merged
Corina (corinagum) merged 2 commits into
mainfrom
cg/rename-content-url
Aug 27, 2026
Merged

Rename IncomingFile.web_url to content_url#580
Corina (corinagum) merged 2 commits into
mainfrom
cg/rename-content-url

Conversation

@corinagum

Copy link
Copy Markdown
Contributor

Renames the public IncomingFile.web_url property to content_url.

This is not a breaking change

The property has never been published. web_url arrived with the "Receive files in personal scope" work and no release has been cut since, so there are no consumers to break in any published form.

This is also the last cheap moment: once the files feature ships, the name is locked.

Why

The value arrives on the wire as the attachment's content_url, and Attachment.content_url already exposes it publicly in this same SDK. That left the same value reachable under two different public names depending on which door you came through:

activity.attachments[0].content_url   # public
ctx.files[0].web_url                  # public, same value, different name

Upstream doesn't call it a "web URL" either. APX sources it from fileInfo.ObjectUrl and writes it into the Bot Framework attachment's ContentUrl slot, so web_url was a name this SDK invented at the boundary. The mapping comment in files_accessor.py was the only thing holding the two vocabularies together, and it's now unnecessary: the value is a straight pass-through.

The one real objection, and how it's handled

content_url sits next to download_url, and it is the one that does not return content. That's a genuine footgun, but it already exists on Attachment.content_url regardless of what we do here, and it's a docs problem rather than a design problem. Two public names for one value is the design problem. So the docstring now states the trap directly:

Browsable URL to the file in OneDrive/SharePoint, as sent on the attachment's content_url. Not fetchable for bytes despite the name; those come from download_url.

Cross-SDK

Companion to microsoft/teams.ts#773 (webUrlcontentUrl), with a matching PR for teams.net (WebUrlContentUrl). The feature is unreleased in all three, so all three can move together. Published docs in teams-sdk are updated separately.

Validation

598 tests pass; poe check clean.

The value arrives on the wire as the attachment's `content_url`, and
`Attachment.content_url` already exposes it publicly, so the same value had
two public names depending on which door a developer came through.

Renaming now is free: the files feature has never been published.

Matches the equivalent rename in teams.ts so the SDKs stay parallel.

Also documents the trap the name invites: this URL is browsable, not
fetchable. Bytes come from `download_url`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7d326e8a-aeb4-4481-bc0a-58d2a012584e

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames the IncomingFile public property from web_url to content_url to match the Bot Framework/attachment wire field name and align terminology with Attachment.content_url already exposed in the SDK.

Changes:

  • Renamed IncomingFile.web_urlIncomingFile.content_url and updated constructor/assignment accordingly.
  • Updated FilesAccessor mapping to populate IncomingFile.content_url from Attachment.content_url.
  • Updated the FilesAccessor unit test to assert on content_url.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/apps/tests/test_files_accessor.py Updates assertions to validate content_url is mapped onto IncomingFile.
packages/apps/src/microsoft_teams/apps/files/incoming_file.py Renames the public attribute/constructor parameter to content_url and updates the docstring warning about download behavior.
packages/apps/src/microsoft_teams/apps/files/files_accessor.py Updates the attachment→IncomingFile mapping to use content_url and revises the explanatory comment.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The docstring told callers bytes come from `download_url`, but that value
is stored as `_download_url`, so the guidance named something a consumer
cannot reach. Points at `download()` and `stream()` instead.

Matches the same correction in teams.ts and teams.net.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7d326e8a-aeb4-4481-bc0a-58d2a012584e
@corinagum
Corina (corinagum) merged commit c60a344 into main Aug 27, 2026
8 checks passed
@corinagum
Corina (corinagum) deleted the cg/rename-content-url branch August 27, 2026 20:30
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.

3 participants