Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

hey compose to [email protected] publishes the post but reports 406 Not Acceptable (retries create duplicate posts)

Open
#556 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
api, cli

Research direction

The payload names no source files. Start by reproducing with hey compose --to [email protected] -v and checking the redirect handling in the Go HTTP client code that sends the compose POST. Decide whether the 302 should count as success or the redirect should not be followed for this send, since the maintainer has not chosen. Done means a successful POST is reported as sent with ok: true, and a test covers the 302-then-406 sequence.

Written by the indexing model from the issue text.

Description

Summary

hey compose to [email protected] (HEY World) publishes the post, but the CLI reports a failure:

{ "ok": false, "error": "API error: 406 Not Acceptable", "code": "api" }

Because the command says it failed, rerunning it publishes the post again. Three runs produced three identical public posts.

Steps to reproduce

hey compose --to [email protected] --subject "Test post" < body.md

Verbose output (-v)

http request method=POST
http response status=302
http request method=GET
http response status=406

The POST succeeds and redirects (302). The CLI follows the redirect with a GET that HEY answers with 406, and then reports the whole send as failed.

Expected

  • Treat the 302 after the POST as success (or do not follow the redirect for this send), and report the post as sent/published.
  • At minimum, do not report ok: false when the message was actually accepted, since scripts and agents will retry it and create duplicates.

Related: an idempotency key for compose (#477) would also prevent duplicate posts.

hey version 1.8.0

Dominant language
Go
Stars
409
Forks
49
Avg merge
23h 49m
Merged PRs (30d)
70

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from basecamp/hey-cli

All issues in basecamp/hey-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.