fix(product): update option values atomically with variants - #16230
fix(product): update option values atomically with variants#16230ryanngit wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: a071653 The changes in this PR will be included in the next version bump. This PR includes changesets to release 79 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! A few items need to be addressed before this can move forward: PR adds option_value_updates to the product update API for atomic option-value and variant updates in one request. The implementation includes row-level locking, optimistic concurrency control, and detailed compensation logic. Extensive test coverage is added. No security or performance issues found. Two convention issues need addressing: the changeset message format and a missing closing-keyword linked issue for the large contribution. Heads up: PR #16116 references #15742 and was opened earlier — the PR body clarifies they are intentional separate scopes, so this is informational only.
Triggered by: manual workflow dispatch |
|
Thanks for the contribution! A few items need to be addressed before this can move forward: PR adds atomic option-value and variant updates to the product update API with deterministic row-level locking and compensation logic. The closing-keyword linked issue has been added (resolving the prior blocking point). One prior blocking point remains: the changeset message must follow the required format. No security, performance, or correctness issues found.
Triggered by: PR description updated |
|
Thanks for the contribution! Initial automated review looks good. Both previously raised blocking points are now resolved: the changeset message is correctly formatted and the PR body includes a closing-keyword link to issue #16304. The new option_value_updates field is properly validated by Zod, reflected in HTTP types and module DTOs, backed by row-level locking, and covered by HTTP integration, workflow, and module-service tests. No security, performance, or correctness issues found. Triggered by: new commit pushed |
Summary
What - Adds
option_value_updatesto product updates so option-valueadditions and removals can run atomically with variant replacement.
Why - Variant updates only resolve values already linked to a product.
Callers that need a new value otherwise have to link it in a separate request,
which can leave partial state or lose concurrent updates.
How - Validates the ID-based value delta, locks affected product and option
rows in deterministic order, applies additions before variant replacement and
removals afterward in one Product Module transaction, and records guarded
compensation state for workflow rollback.
Testing - No Docker or containers used.
git diff --checkpassed.Examples
Not applicable; this extends the existing product update contract.
Checklist
Additional Context
Closes #16304.
Split from #16116 after maintainer review. That PR remains scoped to the
Loyalty plugin behavior related to #15742.