Skip to content

fix(gmail): accept padded raw message encoding#923

Merged
steipete merged 2 commits into
openclaw:mainfrom
goutamadwant:fix-gmail-raw-base64-decoding
Jul 16, 2026
Merged

fix(gmail): accept padded raw message encoding#923
steipete merged 2 commits into
openclaw:mainfrom
goutamadwant:fix-gmail-raw-base64-decoding

Conversation

@goutamadwant

Copy link
Copy Markdown
Contributor

Summary

  • Accept padded and unpadded base64url payloads from Gmail when gog gmail get --format raw renders an RFC822 message.
  • Reuse the existing Gmail raw decoder so interactive retrieval and backup export follow the same decoding rules.
  • Add a command-level regression covering a padded multipart-style raw message response.

Closes #922

Real behavior proof

  • Behavior addressed: a valid padded Gmail raw response failed before rendering the message.
  • Before fix: TestGmailGetCmd_RawAcceptsPaddedBase64URL failed with illegal base64 data at input byte 74.
  • After fix: the same command-level test passes and its output contains the decoded RFC822 message.
  • Exact focused command: go test ./internal/cmd -run '^TestGmailGetCmd_Raw(AcceptsPaddedBase64URL|Empty)$' -count=1
  • Test environment: the command runs against a local HTTP server returning the same Gmail API message shape, including padded base64url data.
  • Limitation: this was not tested against an authenticated Gmail account.

Validation

  • go test ./internal/cmd -count=1
  • go test ./... -count=1
  • go vet ./...
  • make fmt-check
  • make build
  • make deadcode
  • make docker-version-check docs-check agent-skills-check
  • node --test scripts/eval-gws.test.mjs scripts/eval-gws-agents.test.mjs
  • .tools/golangci-lint run --enable-only=govet,staticcheck,errcheck,unused --new-from-rev=origin/main ./internal/cmd/... (0 issues)

The complete 44-linter invocation did not terminate locally after package loading; the focused core linter set passed, and repository CI remains the authoritative full lint run.

Disclosure: AI was used to understand the codebase and review the fix.

@steipete
steipete merged commit 7785477 into openclaw:main Jul 16, 2026
9 checks passed
@steipete

Copy link
Copy Markdown
Collaborator

Landed in 7785477 from exact reviewed head fe7c109.

Proof:

  • Live authenticated Gmail payload: 16,392 raw characters with one padding character. Previous main exited 1 with an illegal-base64 error; this head exited 0 and emitted 12,380 decoded bytes.
  • Local make ci passed.
  • AutoReview passed with no findings.
  • Hosted Linux, Windows, Darwin/cgo, worker, and Docker checks passed on the exact head.

Thanks @goutamadwant for the focused fix and regression test.

lox added a commit to lox/gogcli that referenced this pull request Jul 16, 2026
* lox/fix-calendar-remove-meet:
  fix(calendar): expose --remove-meet
  fix(gmail): accept padded raw message encoding (openclaw#923)
  fix(docs): preserve text-run link targets (openclaw#924)
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.

bug(gmail): get --format raw fails "illegal base64 data" on multipart messages

2 participants