refactor(mattermost): bump Mattermost.NET to 5.0 and delete HTTP-bypass shim - #1163
Merged
Aaronontheweb merged 1 commit intoMay 24, 2026
Merged
Conversation
…ss shim MattermostNetReplyClient carried a parallel HttpClient path with six hand-rolled DTOs (CreatePostPayload, UpdatePostPayload, PropsPayload, AttachmentPayload, ActionPayload, IntegrationPayload) and a snake_case JsonSerializerOptions, built on the assumption that the SDK didn't support attachment props. The SDK has supported PostProps.Attachments with actions since 4.0.4 — the shim duplicated types we could have consumed directly. 5.0 itself is small and additive (typed PostActionType enum, PostPropsButtonAction / PostPropsSelectAction convenience subclasses). The version bump is the natural moment to delete the shim and replace it with `_client.CreatePostAsync(..., PostProps?)` / `_client.UpdatePostAsync(..., PostProps?)`, using PostPropsButtonAction so the literal "button" string disappears. - Drop HttpClient ctor dependency on MattermostNetReplyClient. - Drop the unused `mattermost-api` named HttpClient registration and the parsedServerUri parsing it depended on. - Drop the dead 3-arg `UpdatePostAsync` overload (not on the interface). - Add an integration test asserting that attachments + button actions round-trip via the SDK (Id, Name, PostActionType.Button, ActionStyle). Mattermost server intentionally strips integration.url on read-back (it's the private callback URL) — assertion notes that. All 4,271 unit tests pass; all 12 Mattermost integration tests pass against a real Mattermost container.
Aaronontheweb
force-pushed
the
claude-wt-mattermost-5.0
branch
from
May 24, 2026 11:04
7689beb to
9df06b0
Compare
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.
Summary
Mattermost.NET4.0.4 → 5.0.0 (the version on Dependabot PR Bump Mattermost.NET from 4.0.4 to 5.0.0 #1144).MattermostNetReplyClientand its six hand-rolled DTOs (CreatePostPayload,UpdatePostPayload,PropsPayload,AttachmentPayload,ActionPayload,IntegrationPayload). Replace withMattermostClient.CreatePostAsync(..., PostProps?)/UpdatePostAsync(..., PostProps?), using 5.0's newPostPropsButtonActionso the literal"button"string disappears.mattermost-apinamedHttpClientregistration and theparsedServerUriparsing it depended on.Why
The shim was built on the assumption that the SDK didn't support attachment props. It always has —
PostProps.Attachmentswith action buttons shipped in 4.0.4. The 5.0 bump is a tiny additive release (typedPostActionTypeenum +PostPropsButtonAction/PostPropsSelectActionconvenience subclasses), but it's the natural moment to delete the shim: bundle the cleanup with a version event reviewers will scrutinize, and adoptPostPropsButtonActionto type away the"button"magic string.PostPropsSelectActionfor multi-option dropdown approvals is explicitly deferred.Test plan
dotnet buildclean, 0 warningsNetclaw.Channels.Mattermost.IntegrationTestsagainst a real Mattermost Testcontainer: 12/12 pass, including a new test asserting thatPostPropsButtonActionround-trips through the server withPostActionType.Button+ActionStyle.Primary/Dangerpreserveddotnet slopwatch analyze— 0 issuespwsh ./scripts/Add-FileHeaders.ps1 -Verify— all files have headersCloses #1144 by superseding the bare dependency bump with the corresponding code cleanup.
Net delta:
+103 / -156LOC across 5 files.