A local reply leaves out the people the answered message blind copied

Merged
JE
3h ago
+179-74

Context

When hey reply or the TUI composer cannot get HEY's own reply prefill (it is unavailable or comes back empty), they work out the recipients locally. That local answer copied the answered message's Bcc'd people onto the reply, so a follow-up could reach someone who was blind copied "this once" without the others seeing. HEY stopped doing this in basecamp/haystack#9169, and every HEY client is meant to behave the same way (Jeremy's decision).

Change

  • Both local fallbacks (recipientsForReplyAddressed in internal/cmd/thread_reply.go, recipientsForReplyTo in internal/tui/compose.go) leave the Bcc'd people off a reply.
  • The one exception is haystack's: when Bcc is the whole audience ("To: me, Bcc: the list", or a message only blind copied people received), they stay, in Bcc.
  • Limit: the fallback does not know who is replying, so it treats the message's sender as the replier. A Bcc-only message written by someone else keeps its Bcc here, where HEY drops it. The primary path, the server prefill, is exact and unchanged.

Verification

  • New cases cover the plain drop and both whole-audience keeps. On the old code the two drop cases fail (the keeps pin existing behaviour).
  • make test and make lint pass.

Alternatives

  • Look up the signed-in user's addresses to know the replier exactly: more calls on a path that is already a fallback, and the server prefill covers it. Left out.
  • Drop Bcc always in the fallback: would send a reply to nobody in the whole-audience cases, which HEY keeps addressable.

Follows basecamp/haystack#9169.


Summary by cubic

Stops the local reply fallbacks in hey reply and the TUI composer from carrying the answered message's Bcc'd people onto the reply, matching HEY's behavior from haystack#9169.

  • The shared rule now lives in mail.ReplyRecipientsFor; both callers delegate to it instead of reimplementing HEY's logic in internal/cmd and internal/tui.
  • Bcc'd people stay off unless they are the whole audience ("To: me, Bcc: the list" or a Bcc-only message), in which case they remain in Bcc.
  • The fallback can't know who is replying, so it treats the sender as the replier; a Bcc-only message by someone else keeps its Bcc where HEY drops it, while the server prefill stays exact.
  • The CLI help and manual now say said the fallback leaves out blind copied people unless they are the only audience left.