Add option to exclude attachments from inbound route - #138
Merged
odunayoogungbure-rgb merged 3 commits intoSep 23, 2026
Merged
odunayoogungbure-rgb merged 3 commits into
odunayoogungbure-rgb merged 3 commits into
Conversation
Adds excludeAttachments() to InboundRouteBuilder and the field to the route response model, and documents it in the README. The builder body holds a boxed Boolean so an unset value is omitted from the request: the API rejects an explicit null, and omitting the key on update keeps the route's stored value. Also adds exclude_attachments to the recorded inbound route responses so the fixtures match the shape the API now returns. The request hashes the fixtures are keyed by are unchanged. The forwarding behaviour is not implemented in the API yet, so this must not be released until that change ships. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
odunayoogungbure-rgb
marked this pull request as ready for review
September 17, 2026 08:18
odunayoogungbure-rgb
requested review from
JoaoFSCruz and
PeterOcansey
and removed request for
JoaoFSCruz
September 17, 2026 14:40
PeterOcansey
approved these changes
Sep 21, 2026
UX review inverted the option: a toggle reads best when "on" means the thing in the label is happening. The field is now include_attachments, defaulting to true, so attachments are forwarded unless it is set to false. Renames the builder method, the builder body field and the response model field, and updates the README. The recorded fixtures are hand-edited rather than regenerated. VcrTape keys each response by sha1 of the request url, method and body, and no inbound test sets this field, so the request bodies and their hashes are unchanged — only the recorded response values are renamed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
resolves MSD-15032: Add option to exclude attachments from inbound route
I used AI to generate parts of this PR
Yes
Changelist
include_attachmentson inbound routesinclude_attachmentson inbound routesRisks
The builder body holds a boxed
Boolean, not a primitive, so an unset flag is omitted by Gson rather than sent asfalse. A primitive there would silently drop attachments on every update that did not set it — worst case, routes quietly stop forwarding attachments. Scenario 4 is the one that catches this.Performance impact
None
Security impact
None
How to QA
(API only — no UI)— this is a Java SDK. QA is the test suite plus a short program against a branch env.This cannot be fully QA'd until the API change for MSD-15032 is deployed. Against current production the key is ignored, so scenario 3 will show the field absent. Point the client at a branch env with the API change before QAing scenarios 3 and 4.
Scenario 1 — the recorded test suite still passes
mvn test -Dtest=InboundRoutesTest(via Docker if you have no local maven).VcrTapekeys each response by sha1 of the request url, method and body, and no inbound test sets this field, so the request hashes are unchanged — only the recorded response values were renamed to"include_attachments": true.Scenario 2 — existing calls are unaffected
includeAttachments().main. No 422.include_attachments.Scenario 3 — the flag round-trips
.includeAttachments(false).addRoute(), then fetch it withms.inboundRoutes().getRoute(id).route.includeAttachmentsisfalseon both the add response and the fetch. Creating without the call givestrue.trueafter being set tofalse, which means the@SerializedNameis not matching.Scenario 4 — omitting on update preserves the value
false..updateRoute(id)with a changed name andincludeAttachments()never called. Then fetch the route.includeAttachmentsis stillfalse. Calling.includeAttachments(true)then flips it back.trueafter an update that never mentioned it.Does not need QA:
getRoutes,getRouteanddeleteRouteon their own (unchanged), the SMS inbound route classes (separate package, untouched), and every other part of the SDK.How to release
Standard release — but not before the API change for MSD-15032 is live in production. Publish to Maven Central as usual once it is.
Screenshots, recordings
N/A
🤖 Generated with Claude Code