Skip to content

hey reply sends to wrong recipients and breaks thread continuity #113

@stex

Description

@stex

Summary

hey reply <topic-id> does not actually reply within the original thread. Instead, it sends a new message where:

  • The recipient list is taken from the original message's To/CC/BCC headers (i.e., the original addressees, which includes the current user) — so a reply to an incoming message gets sent back to oneself.
  • No subject is set.
  • The reply does not land in the original thread on the recipient side; a new thread is created.

Steps to reproduce

  1. Receive a message in HEY from someone, e.g., [alice@example.com](mailto:alice@example.com)[me@hey.com](mailto:me@hey.com).
  2. Run hey reply <topic-id> -m "Test reply".
  3. A new thread appears in your own Imbox, addressed From: [me@hey.com](mailto:me@hey.com) / To: [me@hey.com](mailto:me@hey.com), with no subject. The original sender never receives anything.

Expected behavior

A reply should:

  • Be sent to the original sender (and ideally to all other thread participants minus self — classic reply-all semantics).
  • Carry the original subject (or Re: <subject>).
  • Appear as a new entry inside the existing thread for all participants.

Actual behavior

The reply is delivered as a new thread, addressed to self, with no subject.

Root cause

In internal/cmd/reply.go:

topicResp, err := sdk.GetHTML(ctx, fmt.Sprintf("/topics/%d", threadID))
addressed := htmlutil.ParseTopicAddressed(string([topicResp.Data](http://topicresp.data/)))
...
sdk.Entries().CreateReply(ctx, latestEntryID, message, [addressed.To](http://addressed.to/), [addressed.CC](http://addressed.cc/), addressed.BCC)

The recipients handed to CreateReply come from the topic page's existing To/CC/BCC fields. For an incoming message those are the original addressees (including the current user) — not the parties a reply should actually go to. The original sender (From / Reply-To) is never extracted, and no subject is passed.

In contrast, internal/cmd/compose.go with --thread-id calls sdk.Messages().CreateTopicMessage(ctx, topicID, message) — that appends the message to the existing topic and inherits subject and thread membership implicitly, which looks like the correct API for a "reply in thread" use case.

Environment

  • hey version 22aeea7 (current main)
  • Linux, Go binary

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions