Repository navigation
fix(web): resolve webhook registration failure for operations with hy… - #2344
Merged
lbroudoux merged 2 commits intoOct 1, 2026
Merged
Conversation
…phens or slashes Signed-off-by: Shelly Chahar <[email protected]>
shellyco-code
requested review from
SebastienDegodez,
lbroudoux and
yada
as code owners
September 30, 2026 07:17
utafrali
approved these changes
Sep 30, 2026
utafrali
left a comment
There was a problem hiding this comment.
The fix is correct and complete: using indexOf('-') cleanly separates serviceId from operation name regardless of how many hyphens the name contains, and the ! to / decoding is consistently applied across all three affected endpoints. Test coverage is thorough. Two minor issues: wrong @author tag in the new test file, and no explicit guard or test for an operationId starting with -.
Signed-off-by: Shelly Chahar <[email protected]>
lbroudoux
approved these changes
Oct 1, 2026
lbroudoux
left a comment
Member
There was a problem hiding this comment.
LGTM. Thanks @shellyco-code for the good catch and the contribution!
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.
Description
Fixes an issue where webhook registration in
WebhookControllerfails for operations whose names contain hyphens (-) or slashes (/).Fixes #2343
Root Cause
WebhookController.registerToWebhookparsedoperationIdusing.split("-")and checkedparts.length != 2. For operation names with hyphens (e.g.,order-placed-event WEBHOOK), this produced 3+ parts, resulting in an immediate 404 ("OperationId is invalid").webhook.service.ts) encodes slashes/as!(encodeOperationId()) to avoid routing issues in URL paths. However,WebhookControllerdid not decode!back to/, causingop.getName().equals(operationName)to fail andfindByOperationId/countByOperationIdto query mismatched identifiers.Changes Made
WebhookController.java:.split("-")withindexOf('-')to cleanly separateserviceIdfromoperationName.rawOperationId.!back to/inoperationNameduring registration.!back to/inlistWebhookRegistrationsForOperationandcountWebhookRegistrationsForOperation.WebhookControllerTest.javaverifying:Testing & Validation
mvn test -Dtest=WebhookControllerTest(10 tests run, 0 failures, 0 errors).mvn spotless:check -pl webapp(0 violations).AI Contribution Disclosure
In accordance with the Microcks AI Contribution Policy, this contribution was developed with the assistance of an AI coding assistant. The code changes, architecture, and tests were reviewed and verified for correctness. No AI commit trailers are included.