Skip to content

CEXT-6421: add isWebhookSuccessful helper to lib-webhooks#563

Merged
obarcelonap merged 9 commits into
mainfrom
webhook-successful
Jul 10, 2026
Merged

CEXT-6421: add isWebhookSuccessful helper to lib-webhooks#563
obarcelonap merged 9 commits into
mainfrom
webhook-successful

Conversation

@obarcelonap

Copy link
Copy Markdown
Member

Description

Add isWebhookSuccessful() to @adobe/aio-commerce-lib-webhooks/responses to determine whether a webhook action's result is successful.

Related Issue

CEXT-6421

Motivation and Context

Adobe Commerce webhooks always respond with HTTP 200, even when the handler wants to signal an error — the actual outcome is only visible in the response body's op field (op: "exception" = failure). Tooling that instruments webhook actions generically, such as tracing libraries (e.g. aio-lib-telemetry), can't rely on the status code alone to classify the result. This helper closes that gap.

How Has This Been Tested?

Added unit tests covering: non-200 status codes, missing/no-op bodies, exception operations, success/add/replace/remove operations, arrays of operations, and non-object inputs. Ran pnpm --filter @adobe/aio-commerce-lib-webhooks test (100% coverage), typecheck, and lint.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2298640

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@adobe/aio-commerce-lib-core Minor
@adobe/aio-commerce-lib-webhooks Minor
@adobe/aio-commerce-lib-admin-ui Patch
@adobe/aio-commerce-lib-api Patch
@adobe/aio-commerce-lib-app Patch
@adobe/aio-commerce-lib-auth Patch
@adobe/aio-commerce-lib-config Patch
@adobe/aio-commerce-lib-events Patch
@adobe/aio-commerce-sdk Patch
@aio-commerce-sdk/common-utils Patch
@aio-commerce-sdk/scripting-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the with-changeset The PR contains a Changeset file. label Jul 9, 2026
Comment thread .changeset/eighty-tires-read.md Outdated
Comment thread packages/aio-commerce-lib-webhooks/docs/usage.md Outdated
Comment thread packages/aio-commerce-lib-webhooks/source/responses/helpers.ts
obarcelonap and others added 3 commits July 10, 2026 10:46
@github-actions github-actions Bot added the pkg: aio-commerce-lib-core Includes changes in `packages/aio-commerce-lib-core` label Jul 10, 2026
Comment thread packages/aio-commerce-lib-core/source/responses/helpers.ts Outdated
Comment thread packages/aio-commerce-lib-webhooks/source/responses/helpers.ts
Comment thread packages/aio-commerce-lib-webhooks/source/responses/types.ts
obarcelonap and others added 2 commits July 10, 2026 12:29
Co-authored-by: Ivan Porto Wigner <dev.ivanporto@gmail.com>

@jcuerdo jcuerdo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one comment

Comment thread packages/aio-commerce-lib-webhooks/source/responses/types.ts
@obarcelonap
obarcelonap merged commit 19400fb into main Jul 10, 2026
5 checks passed
@obarcelonap
obarcelonap deleted the webhook-successful branch July 10, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: aio-commerce-lib-core Includes changes in `packages/aio-commerce-lib-core` pkg: aio-commerce-lib-webhooks with-changeset The PR contains a Changeset file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants