fix(fulfillment,core-flows): support polymorphic cancel guard and add address country code fallback - #16761
Conversation
… address country code fallback
🦋 Changeset detectedLatest commit: fb0b202 The changes in this PR will be included in the next version bump. This PR includes changesets to release 83 packages
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 |
|
Thanks for the contribution! We need more information before reviewing this further. The author submits three targeted fixes: (1) using this.constructor for polymorphic static dispatch of canCancelFulfillmentOrThrow in the fulfillment module service so subclasses can override the guard, (2) adding a guard in updateOrderValidationStep so country-code conflict validation is only triggered when the order already has an existing country code in the relevant address, and (3) making the workflow-engine-redis loader accept a top-level redisUrl option in addition to the nested redis object format. Each fix includes a focused unit test. No security issues were found in the diff. However, the PR body does not follow the project's PR template — the required What, Why, How, and Testing sections are absent, replaced with a custom Summary/Files Changed format. A changeset is also missing for this source change under packages/. Heads up: several earlier open PRs reference the same underlying issues. PR #16745 (opened 2026-09-07) references issue #16744 (fulfillment polymorphism); PR #16637 (opened 2026-08-27) references issue #16636 (order address country code); PR #16699 (opened 2026-09-02) references issue #16697 (redis top-level options). If any of those earlier PRs are merged first, this PR may be closed as a duplicate. Triggered by: new PR opened |
|
I updated the PR description to include the required What, Why, How, and Testing sections. The implementation and focused tests were already present; the remaining red checks are CI environment/package failures shown in the checks. |
|
Thanks for the contribution! A few items need to be addressed before this can move forward: The author updated the PR body to include the required What/Why/How/Testing sections — that prior issue is resolved. Three outstanding concerns remain. The underlying logic changes are reasonable: adding a guard so the order-update validation only rejects a country-code change when the order already has a country code, switching to this.constructor for polymorphic static dispatch in the fulfillment service, and accepting top-level Redis options in the workflow-engine-redis loader. No security issues and no performance issues were found in the diff. However, two of the three added test files contain issues that would cause them to fail, and a changeset is still missing.
Triggered by: PR description updated |
|
Addressed the latest bot review: added the changeset, linked the related issues in the PR body, mocked in the fulfillment test, and replaced the test with a direct exported validation handler. |
|
Small correction: the shell ate the inline code names in my previous comment. Addressed the latest bot review: added the changeset, linked the related issues in the PR body, mocked |
|
Thanks for the contribution! A few items need to be addressed before this can move forward: The author has addressed all issues raised in the previous review: the PR template is complete with all required sections, linked issues are present (Closes #16744, #16636, #16697), a changeset file was added, the fulfillment test now mocks baseRepository_, and the order-update test was refactored to import and call updateOrderValidationHandler directly. The three underlying logic changes are sound: switching to this.constructor for polymorphic static dispatch of the cancel guard, gating the country-code conflict check on the order already having a country code, and accepting top-level Redis options via options?.redis ?? options ?? {}. No security or performance issues were found. Two items remain before the PR is ready.
Triggered by: PR description updated |
|
Thanks for the contribution! A few items need to be addressed before this can move forward: This is a re-review following the author's latest update. Three previously raised issues have been resolved: the PR template is complete with all required sections, linked issues are present (Closes #16744, #16636, #16697), and the order-update test was refactored to import and call the exported updateOrderValidationHandler directly rather than reaching into createStep internals. The three underlying logic changes remain sound: switching to this.constructor for polymorphic static dispatch of the cancel guard, gating the country-code conflict check on the order already having a country code, and accepting top-level Redis options via options?.redis ?? options ?? {}. No security or performance issues were found. Two items raised in the previous review are still unresolved in the current diff.
Triggered by: new commit pushed |
What
Fix three independent edge cases:
redisUrloptions in the workflow-engine Redis loader.Why
These cases caused incorrect validation failures, prevented polymorphic service behavior, or rejected a supported configuration shape.
How
The implementation changes the static dispatch and country-code guard conditions, and normalizes the Redis loader's accepted option shapes. Each behavior has a focused regression test.
Testing
@medusajs/fulfillment,@medusajs/core-flows, and@medusajs/workflow-engine-redis.Linked issues
Closes #16744
Closes #16636
Closes #16697