Skip to content

mailcompose: tighten Subject folding tests and line packing after #283 #284

Open

Description

@itsjeremyjohnson

Three test and folding follow-ups from the review of #283 (merge 0e16ad3a1cf675aa568ffc0edefe7193d5e186b3). Refs itsjeremyjohnson/fleet#805. None of them blocks the fix: the review found no correctness defect.

  • Line bound in the test is 78, not 76. mime_test.go asserts len(line) > 78, while the CHANGELOG says Subject folds at 76 bytes. A regression to 77 or 78 byte lines would still pass. Fix: assert <= encodedWordLineBytes.
  • TestComposeFoldsEncodedSubject trims before comparing. mailcompose_test.go:1104 compares strings.TrimSpace(decoded) with the input, and its input ("Sujeté " x30) never yields a pure-ASCII chunk. This is the test that let fleet#805 through. Fix: compare exactly, or move the fix(gmail): add reply-all recipients for draft replies openclaw/gogcli#805 cases into a Compose-level table and drop the duplicate.
  • Folded lines are shorter than they need to be. Every encoded-word is sized for the 67-byte first-line budget, so continuation lines end near 66 to 68 bytes instead of up to 75. One option is a Subject-specific line builder: first word 67 bytes, later words 75, joined with "\r\n ". Optional; current output is compliant.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions