bug(gmail): `+read` silently loses body content — prefers empty text/plain part, truncates, drops anchor hrefs

未關閉
#889 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

  • #897 來自 @jokrasno —— 已關閉,未合併

評估

難度
4/5
預估耗時
3-5 天
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
rust
領域
cli

研究方向

Start with the gws gmail +read entry point in version 0.22.5 and reproduce the three reported cases: multipart/alternative mail, the 3,209-byte draft, and HTML containing anchor links. Compare the decoded output with the source bodies, then verify that richer content, href targets, entities, line breaks, and any truncation marker are preserved.

由索引模型根據 Issue 內容生成。

描述

gws gmail +read returns incomplete message bodies with no indication that content was dropped. Three distinct failures, all silent:

1. Prefers a stub text/plain part over a rich text/html part. On a real multipart/alternative message, the text part was 59 chars with zero URLs; the HTML part was 17,590 chars containing 6 links. +read returned the 59-char stub, discarding the entire message.

2. Truncates. A 3,209-byte draft came back as 198 bytes, cut mid-word. No [truncated] marker.

3. Drops anchor targets. HTML→text conversion discards href values, so any message whose payload is a link — invitations, password resets, portal access, OTP magic links — is unreadable. One invitation rendered as invisible word-joiner characters with no URL at all.

Also: HTML entities aren't unescaped (' appears literally) and block elements don't produce line breaks, so multi-paragraph bodies collapse to one line.

Impact: consumers can't tell content was lost. Worse for drafts — a correct outbound draft looks mangled, and the natural response is to delete and rebuild it.

Suggested: emit the full decoded body, select the richer alternative part when text/plain is empty or substantially shorter, preserve href targets (inline or as a link list), unescape entities, and if any cap is retained, print an explicit [truncated N bytes] marker.

Version: 0.22.5

主要語言
Rust
星號
32.3k
分支
2k
平均合併
16 小時 3 分鐘
30 天內合併 PR
1

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

googleworkspace/cli 的其他 Issue

查看 googleworkspace/cli 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。