Repository navigation
fix(platform/tasks): answer 409 when a payment cancel finds the payment settled - #463
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
4959471 to
915f38f
Compare
915f38f to
cf6b648
Compare
…nt settled A cancel that reached a payment that had already settled returned a 500 because writeCompletion did not know the error. The payment plugin wraps payment.ErrPaymentSettled with orchestrator.ErrStepConflict, and writeCompletion answers any ErrStepConflict with 409 and the audit code step_conflict, so the task API needs no knowledge of any one plugin's errors. A cancel on a step with no checkout, or for a reference that is not its checkout, is a fault and stays an ordinary error. Refs OpenNSW/nsw-srilanka#1158
cf6b648 to
14682e9
Compare
core/platform 76b6925 answers a cancel for a payment that already settled with 409 (OpenNSW/core#463), which api/tasks.openapi.yaml documents. It also moves the core root to 7302004 and, through them, a few indirect modules. Refs OpenNSW#1158
core/platform 76b6925 answers a cancel for a payment that already settled with 409 (OpenNSW/core#463), which api/tasks.openapi.yaml documents. It also moves the core root to 7302004 and, through them, a few indirect modules. Refs OpenNSW#1158
core/platform 76b6925 answers a cancel for a payment that already settled with 409 (OpenNSW/core#463), which api/tasks.openapi.yaml documents. It also moves the core root to 7302004 and, through them, a few indirect modules. Refs OpenNSW#1158
core/platform 76b6925 answers a cancel for a payment that already settled with 409 (OpenNSW/core#463), which api/tasks.openapi.yaml documents. It also moves the core root to 7302004 and, through them, a few indirect modules. Refs OpenNSW#1158
* docs(tasks): document cancelling a pending payment step Describe letting the payer choose another method: the artifacts a step opts in with, and the 409 a cancel gets once the payment has settled. * build(deps): upgrade core/platform for the 409 on a settled payment core/platform 76b6925 answers a cancel for a payment that already settled with 409 (OpenNSW/core#463), which api/tasks.openapi.yaml documents. It also moves the core root to 7302004 and, through them, a few indirect modules. Refs OpenNSW#1158
What
A cancel that reaches a payment that already settled returned a 500, because the task API did not know the error. It now answers
409 Conflictwith the audit codestep_conflict.payment.ErrPaymentSettledwithorchestrator.ErrStepConflict(added in feat(taskflow): add ErrStepConflict for a plugin that refuses a resume #465). The original error still matches witherrors.Is.writeCompletionmapsorchestrator.ErrStepConflictto 409, so the task API needs no knowledge of any one plugin's errors.ErrNoCheckoutToCancel), or for a reference that is not its checkout (ErrTransactionNotFound), is a fault, not a stale view. It stays an ordinary error and answers 500 with an error log.platformnow requires the core commit that hasErrStepConflict.A cancel never completes the step. A caller that gets the 409 should refetch the task.
Why
#452 added the cancel and this error came out of it. The mapping lived in nsw-srilanka's task handler, which moved here in #444, so the 409 was lost.
Testing
TestWriteCompletion_StepConflictIsAConflictcovers the sentinel and a manager-wrapped error. The paymentResumetests check that a settled payment matchesErrStepConflict, and that a missing checkout and an unknown reference do not.Refs OpenNSW/nsw-srilanka#1158
Summary by CodeRabbit