hey compose to [email protected] publishes the post but reports 406 Not Acceptable (retries create duplicate posts)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
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: falsewhen 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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from basecamp/hey-cli
-
TUI Calendar: Enter does nothing on a highlighted event (Day/Week), though the help bar shows "enter: open"Possibly taken @albertreig claimed this 32 days ago. OpenCLI Only
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
CLI Only
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
basecamp/hey-cli#408 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 18/100
Maintainers usually reply within 1 day
All issues in basecamp/hey-cli
Similar issues
-
raised-by:reviewer
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
medici-finance/assay#2681 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
homarr-labs/dashboard-icons#2939 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
AvengeMedia/DankMaterialShell#3761 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
docs: clarify replacement for outdated Terms of Service URL in readme.mdPossibly taken @mohitjoshi-hey claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 66/100