Rename IncomingFile.WebUrl to ContentUrl - #662
Merged
Merged
Conversation
The value arrives on the wire as the attachment's `ContentUrl`, and `Attachment.ContentUrl` 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. The shipped `Microsoft.Teams.Apps` 2.1.0 package on NuGet contains no `IncomingFile` and no `WebUrl`, in either the assembly or its XML docs. Matches the equivalent renames in teams.ts and teams.py so the SDKs stay parallel. `Microsoft.Teams.Cards`' unrelated `WebUrl` is untouched. Also documents the trap the name invites: this URL is browsable, not fetchable. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7d326e8a-aeb4-4481-bc0a-58d2a012584e
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Renames the Files SDK surface for the browsable attachment link from IncomingFile.WebUrl to IncomingFile.ContentUrl, aligning the Files API with the Bot Framework attachment wire name (contentUrl) and the existing Attachment.ContentUrl naming.
Changes:
- Renamed
IncomingFile.WebUrltoIncomingFile.ContentUrland updated its XML documentation. - Updated
FilesAccessormapping to populateIncomingFile.ContentUrlfromTeamsAttachment.ContentUrl. - Updated Files unit tests to assert against
ContentUrland ensure percent-encoding behavior remains intact.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/Microsoft.Teams.Apps.UnitTests/Files/FilesAccessorWireShapeTests.cs | Updates wire-shape mapping assertions to use ContentUrl. |
| test/Microsoft.Teams.Apps.UnitTests/Files/FilesAccessorTests.cs | Updates unit test expectations to use ContentUrl. |
| src/Microsoft.Teams.Apps/Files/IncomingFile.cs | Renames the public property to ContentUrl and refreshes its XML doc. |
| src/Microsoft.Teams.Apps/Files/FilesAccessor.cs | Renames the mapped initializer property to ContentUrl. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The doc comment told callers bytes come from "the download URL", but `DownloadUrl` is internal, so the guidance named something a consumer cannot reach. Points at `DownloadAsync` and `StreamAsync` instead. Matches the same correction in teams.ts and teams.py. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7d326e8a-aeb4-4481-bc0a-58d2a012584e
Kavin (singhk97)
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renames the public
IncomingFile.WebUrlproperty toContentUrl.This is not a breaking change
The property has never been published, despite this repo having shipped a stable
2.1.0. Verified rather than assumed:Microsoft.Teams.Apps2.1.0 (the current stable) from NuGet and inspected it. It contains zero occurrences ofIncomingFileand zero occurrences ofWebUrl, in both the assembly and its generated XML doc surface.So there are no consumers to break. 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
ContentUrl, andAttachment.ContentUrlalready 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:Upstream doesn't call it a "web URL" either. APX sources it from
fileInfo.ObjectUrland writes it into the Bot Framework attachment'sContentUrlslot, soWebUrlwas a name this SDK invented at the boundary. The mapping comment inFilesAccessor.cswas 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
ContentUrlsits next to the download URL, and it is the one that does not return content. That's a genuine footgun, but it already exists onAttachment.ContentUrlregardless 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 doc comment now states the trap directly:Scope note
Microsoft.Teams.Cardshas an unrelatedWebUrl(Adaptive Card Loop metadata). It is deliberately untouched; the rename is scoped to the Files namespace. The build succeeding is itself proof of completeness, since any stale reference would fail to compile.Cross-SDK
Companion to microsoft/teams.ts#773 and microsoft/teams.py#580. The feature is unreleased in all three, so all three can move together. Published docs in
teams-sdkare updated separately.Validation
Build clean (0 errors). 528 unit tests pass on net10.0, including all 32 Files tests.