Skip to content

Add option to exclude attachments from inbound route - #138

Merged
odunayoogungbure-rgb merged 3 commits into
mainfrom
feature/msd-15032-add-option-to-exclude-attachments-from-inbound-route
Sep 23, 2026
Merged

odunayoogungbure-rgb merged 3 commits into
mainfrom
feature/msd-15032-add-option-to-exclude-attachments-from-inbound-route

Conversation

@odunayoogungbure-rgb

@odunayoogungbure-rgb odunayoogungbure-rgb commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

resolves MSD-15032: Add option to exclude attachments from inbound route

I used AI to generate parts of this PR

Yes

Changelist

  • Accept include_attachments on inbound routes
  • Return include_attachments on inbound routes
  • Document the option in the README

Risks

The builder body holds a boxed Boolean, not a primitive, so an unset flag is omitted by Gson rather than sent as false. 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

  • Setup: none beyond a checkout of the branch.
  • Steps: run mvn test -Dtest=InboundRoutesTest (via Docker if you have no local maven).
  • Expect: all inbound route tests pass against the recorded fixtures. The fixtures were hand-edited, not regenerated: VcrTape keys 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.
  • If broken: a test tries to reach the network and fails with a 401, which would mean a request hash stopped matching a fixture key.

Scenario 2 — existing calls are unaffected

  • Setup: an account with a verified domain that can hold an inbound route.
  • Steps: create a route with the README's "Create an inbound route" example as it read before this change, without calling includeAttachments().
  • Expect: the route is created, same as on main. No 422.
  • If broken: a 422 naming include_attachments.

Scenario 3 — the flag round-trips

  • Setup: as above, against a branch env with the API change.
  • Steps: build a route with .includeAttachments(false).addRoute(), then fetch it with ms.inboundRoutes().getRoute(id).
  • Expect: route.includeAttachments is false on both the add response and the fetch. Creating without the call gives true.
  • If broken: the field stays true after being set to false, which means the @SerializedName is not matching.

Scenario 4 — omitting on update preserves the value

  • Setup: the route from scenario 3, with the flag false.
  • Steps: call .updateRoute(id) with a changed name and includeAttachments() never called. Then fetch the route.
  • Expect: the name changed and includeAttachments is still false. Calling .includeAttachments(true) then flips it back.
  • If broken: the flag resets to true after an update that never mentioned it.

Does not need QA: getRoutes, getRoute and deleteRoute on 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

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 odunayoogungbure-rgb self-assigned this Sep 17, 2026
@odunayoogungbure-rgb
odunayoogungbure-rgb marked this pull request as ready for review September 17, 2026 08:18
@odunayoogungbure-rgb
odunayoogungbure-rgb requested review from JoaoFSCruz and PeterOcansey and removed request for JoaoFSCruz September 17, 2026 14:40
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>
@odunayoogungbure-rgb
odunayoogungbure-rgb merged commit 5cd5767 into main Sep 23, 2026
3 checks passed
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.

2 participants