Skip to content

Conversation

@alexluong
Copy link
Collaborator

@alexluong alexluong commented Oct 21, 2025

* feat: destwebhookstandard

* chore: destination webhook mode

* fix: metadata.json

* fix: destination type

* test: verify delivery using official standard-webhooks sdk

* feat: configurable webhook header prefix

* docs: generate config

* fix: prevent response body from being consumed twice in webhook error handling

When webhook requests fail (status >= 400), the response body was being
read twice - once with io.ReadAll() and again in parseResponse(). Since
HTTP response bodies are streams, the second read would get an empty
result, causing delivery.Response to have an empty body instead of the
actual error message.

This fix removes the duplicate read and lets parseResponse() handle all
body reading. The parsed body is then extracted from delivery.Response
for error metadata.

Affects:
- internal/destregistry/providers/destwebhook/destwebhook.go
- internal/destregistry/providers/destwebhookstandard/destwebhookstandard.go

Impact: Failed webhook deliveries will now correctly capture and display
the actual error response body from endpoints, improving debuggability.

Or a more concise version:

fix: prevent double-read of webhook response body on error

Response body was consumed twice in error path (status >= 400):
first by io.ReadAll(), then by parseResponse(). This caused empty
bodies in delivery responses, hiding actual error messages.

Fixed by removing the first read and extracting the body from
delivery.Response after parseResponse() completes.

Fixes both destwebhook and destwebhookstandard providers.

* chore: update metadata.json to be consistent with webhook destination
* feat: idgen

* feat: idgen destination

* feat: idgen delivery

* feat: idgen event

* feat: idgen installation

* fix: unused import

* test: remove uuid usage from test files

* chore: rename idgen config

* docs: generate config

* chore: gofmt
* feat: implement delivery retry schedule

* docs: generate config

* chore: typo
@vercel
Copy link

vercel bot commented Oct 21, 2025

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

Project Deployment Preview Comments Updated (UTC)
outpost-docs Ready Ready Preview Comment Oct 21, 2025 1:15pm
outpost-website Ready Ready Preview Comment Oct 21, 2025 1:15pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

* feat: add delivery_metadata and metadata fields to Destination model

Add two new fields to the Destination model:
- delivery_metadata: Static key-value pairs merged into event data on delivery
- metadata: Arbitrary contextual information stored but not sent with events

Both fields are map[string]string for simplicity and consistency with existing Config and Credentials fields. The metadata field reuses the existing Metadata type from event.go.

* feat: add delivery_metadata and metadata fields to Destination model

- Add DeliveryMetadata and Metadata fields to Destination struct
- Implement Redis persistence for both fields in UpsertDestination
- Add deserialization logic in parseRedisHash to handle optional fields
- Update test suite to verify persistence of new fields
- Add test coverage for nil field handling

* feat: encrypt delivery_metadata field

* feat: add delivery_metadata and metadata fields to destination API

* feat: implement delivery_metadata merging in BasePublisher

* feat: add delivery_metadata support to all destination providers

* test: verify delivery_metadata

* chore: update openapi.yaml

* docs: document metadata & delivery_metadata
* feat: support configurable idempotency key ttl

* refactor: idempotence params

# Conflicts:
#	internal/services/api/router_test.go

# Conflicts:
#	internal/services/delivery/delivery.go

* chore: remove unused func
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.

1 participant