Skip to content

Name captured samples with the registry's safe stem - #76

Merged
garethx merged 2 commits into
mainfrom
fix/request-receiver-stem
Oct 27, 2026
Merged

garethx merged 2 commits into
mainfrom
fix/request-receiver-stem

Conversation

@garethx

@garethx garethx commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Gareth · project thread

Before: requestReceiver.ts named a captured file by replacing only /, : and \ in the resolved topic. The registry files every doc sample under its safe stem instead, so a live capture of an event that already has a doc sample landed in a second file beside it: soft bounce.json next to mailtrap's soft.bounce.json, pubnub.com.schemas.events.channel.created?v=1.0.0.json next to PubNub's ...channel.created.v.1.0.0.json, and the same for castle ($list_item.created), descope (Change Password), flexport (/shipment_leg#departed) and document360 (titles with spaces).

After: the receiver names files with safeStem, which applies the registry's rule. A capture now overwrites the doc sample for its event, as it should.

How: safeStem in topic.ts ports safe_stem from the registry's generator/harvest_doc_examples.py (re.sub(r"[^A-Za-z0-9._-]+", ".", t).strip(".") or "_unnamed"): each run of unsafe characters becomes one . and outer dots are dropped. requestReceiver.ts uses it in place of the old replace. topic.test.ts checks it against six real topics, asserting that the expected file already exists under providers/, plus the edge cases (runs collapse, ._- kept, outer dots stripped, empty input becomes _unnamed). The README's capture section now describes the rule. yarn compile && yarn test pass (26 tests).

Worth a look: most registry harvesters use this rule, but harvest_azure_event_grid.py and harvest_vapi.py replace each unsafe character with _. Their topics contain no unsafe characters today, so none of their samples is affected.


Generated by Claude Code

Update (91e1b49): this PR also moves providers/relay-messenger/latest/ to providers/relay-messenger/2026-08-30/, to match hookdeck/webhook-registry#121, which files Relay's doc samples under the envelope's fixed webhook_version. The eight files are unchanged; index.json now points latest_version and provenance at 2026-08-30. The directory is byte-identical to the registry's samples-doc copy. yarn compile && yarn test still pass.


Generated by Claude Code

requestReceiver.ts only replaced / : \ in the resolved topic, while the
registry files every doc sample under safe_stem (runs of characters outside
[A-Za-z0-9._-] become one ".", outer dots stripped). A live capture for
PubNub, castle, descope, flexport, mailtrap (soft bounce) or document360
(titles with spaces) was therefore written as a second file beside the doc
sample. Add safeStem to topic.ts with the registry's rule, use it in the
receiver, and test it against existing sample file names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7eqaQdKAUzQXRbGtym1PF
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
webhook-samples Ready Ready Preview Oct 27, 2026 4:18pm UTC

Request Review

Every Relay envelope carries webhook_version 2026-08-30, which Relay
documents as the fixed payload version, and hookdeck/webhook-registry#121
files the doc samples under that directory (as linq's are). Move the eight
files unchanged and point index.json's latest_version and provenance at it,
matching the registry's samples-doc copy byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7eqaQdKAUzQXRbGtym1PF
@garethx
garethx merged commit 17957cd into main Oct 27, 2026
3 checks passed
@garethx
garethx deleted the fix/request-receiver-stem branch October 27, 2026 16:27

This branch was successfully deployed

1 active deployment
Preview — 91e1b492 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants