The payment resources should check whether the "place" transition is allowed

Created on 23 February 2023, over 2 years ago

Problem/Motivation

Currently, we don't check whether the transition is allowed before attempting to apply it.

As a result, if a state transition guard is implemented it'll be ignored.

If the transition is simply not allowed by the workflow, it'll crash so we have to handle this more gracefully.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇱Israel jsacksick

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

  • Issue created by @jsacksick
  • Status changed to Needs review over 2 years ago
  • 🇮🇱Israel jsacksick

    Initial proposal at this point, requires tests.

    Wondering between throwing a BadRequestHttpException or an UnprocessableEntityHttpException. We seem to be a bit inconsistent here.

    I think we should go with UnprocessableEntityHttpException according to the specs as a 400 response code indicates that the request is malformed while UnprocessableEntityHttpException seems to be what should be used in case of validation errors.

    • jsacksick committed c296f623 on 8.x-1.x
      Issue #3343933 by jsacksick: The payment resources should check whether...
  • Status changed to Fixed over 2 years ago
  • 🇮🇱Israel jsacksick

    Decided to go ahead with this.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024