Skip to content

fix: trim trailing spaces in invoice attachment filenames#810

Open
miachillgood wants to merge 1 commit into
XeroAPI:masterfrom
miachillgood:codex/trim-attachment-filenames
Open

fix: trim trailing spaces in invoice attachment filenames#810
miachillgood wants to merge 1 commit into
XeroAPI:masterfrom
miachillgood:codex/trim-attachment-filenames

Conversation

@miachillgood

Copy link
Copy Markdown

Summary

  • trim trailing spaces from fileName before building the invoice attachment path
  • apply the same normalization to both create and update invoice attachment-by-filename calls
  • add regression coverage that verifies the generated request URL no longer includes trailing spaces

Why

Issue #763 reports that invoice attachment uploads fail when the filename has trailing spaces. Today the SDK forwards the filename verbatim into the path segment, so "invoice copy.pdf " becomes a different attachment path than "invoice copy.pdf". Trimming the trailing whitespace on the client side matches the practical expectation for filenames and avoids the server-side 500 path.

Validation

  • npm test -- --runInBand
  • npm run build

Closes #763

@miachillgood miachillgood marked this pull request as ready for review June 12, 2026 15:23
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.

Invoice Attachment Upload Fails with 500 Server Error (when filename contains spaces)

1 participant