Skip to content

Fix resource lifecycle webhook payload mismatch#218

Merged
roncodes merged 1 commit into
fleetbase:dev-v1.6.50from
blockalicious-io:fix-resource-lifecycle-webhook-payload
Jun 4, 2026
Merged

Fix resource lifecycle webhook payload mismatch#218
roncodes merged 1 commit into
fleetbase:dev-v1.6.50from
blockalicious-io:fix-resource-lifecycle-webhook-payload

Conversation

@PremSharma-Intelegencia

Copy link
Copy Markdown

Summary

This PR fixes a payload mismatch in SendResourceLifecycleWebhook.

Previously, the listener stored the API event using $event->getEventData(), but sent the webhook using $event->data. Because these values can be resolved at different times, the payload stored in api_events.data could differ from the payload actually sent to integrators.

This change computes the lifecycle payload once and reuses it for both the stored ApiEvent record and the outbound webhook request body.

Background

For order.completed webhooks, we observed cases where the payload recorded in the database did not match the payload sent to the webhook endpoint. This made it difficult to rely on api_events.data as an accurate record of delivered webhook data.

Changes

  • Compute $payload = $event->getEventData() once in SendResourceLifecycleWebhook
  • Store $payload in api_events.data
  • Send $payload as the outbound webhook body

Related PRs

Compute the resource lifecycle payload once in SendResourceLifecycleWebhook and use the same value for both the persisted ApiEvent data and the outbound webhook request body. This prevents webhook deliveries from diverging from the api_events.data record when the event snapshot and live model payload differ.
@roncodes roncodes changed the base branch from main to dev-v1.6.50 June 4, 2026 13:18
@roncodes roncodes merged commit 9c05d89 into fleetbase:dev-v1.6.50 Jun 4, 2026
1 check passed
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.

3 participants