Read the error reason out of data, not just message - #15
Merged
Conversation
Hookdeck does not always put the human reason in `message`. A delivery-group
upsert on a project without the entitlement answers:
{"level":"info","handled":true,"report":true,
"data":["Delivery groups are not enabled for this organization"],
"status":422,"code":"UNPROCESSABLE_ENTITY"}
`describeHookdeckPayload` knew about `message` and `errors`, so this fell
through to the stringify fallback and the whole body reached the activation
banner. The user met `"level":"info"` and `handled:true` before the reason —
on a hard failure, which reads as a broken node rather than a feature the
organization has not been given.
Reading `data` turns it into:
Hookdeck API request failed (HTTP 422): PUT /connections — Delivery groups
are not enabled for this organization
Verified against the live API, not only the unit mock.
The two tests use the captured body verbatim and assert the internal fields do
not survive, because the defect was never that the reason was missing — it was
that the reason arrived behind four fields that made it look like debug output.
Delivery Group Key now also says in its description that this is an early
access feature and what happens on publish without it. The failure landing at
publish time, after the option is configured, is the part worth pre-empting.
Closes #11
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XtT85W8PPr2S8RW2WhCtpi
The unit tests cover this shape with a stub, which fixes the shape in place: if Hookdeck changed where it puts the reason, they would keep passing while users went back to reading `"level":"info"` on a hard failure. A delivery-group upsert on a project without the entitlement is the one live case that reaches this path, and the suite already meets it. Asserting the envelope is absent before skipping costs nothing and ties the rendering to a real response. Checked against the unfixed code, where it fails. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
garethx
force-pushed
the
fix/delivery-groups-error-rendering
branch
from
August 26, 2026 09:10
1469020 to
9974159
Compare
This was referenced Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11.
What changed
describeHookdeckPayloadhandledmessageanderrorsbut notdata. Hookdeck's 422s put the human reason indata, so the whole body fell through to the stringify fallback:Before
After
Both captured by running the node's own transport against the live API, not just the unit mock.
The defect was never that the reason was missing. It was that it arrived behind
"level":"info"andhandled:true, which makes a hard failure look like debug output from a broken node.Also: Delivery Group Key now says in its description that delivery groups are early access and what publishing does without them. The failure otherwise lands at publish time, after you have configured the option.
Testing
npm run lintnpm run buildnpm run scanverify-package-load.mjsnode --test test/unit.test.mjsTwo new tests. The first uses the captured body verbatim and asserts
"level"andhandleddo not reach the message — a test that only checked the reason was present would have passed before this change too, since the reason was always in the stringified blob. The second pins the case where bothmessageanddataare set, which the existing suite had but never exercised (its fixture carried amessage, so thedataarray was dead weight).I did not run
test:live; nothing here touches provisioning or delivery.Notes
No version bump, per
CONTRIBUTING.md— the tag is the version. On its own this is a0.2.1.Worth knowing while #11 is open elsewhere: the underlying API behaviour is unchanged. A reader who configures Delivery Groups without the entitlement still cannot use them; they now get told why in a sentence. The hookdeck/website announcement has an open question about whether delivery groups reach GA before that post ships.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XtT85W8PPr2S8RW2WhCtpi