BEMADEV / Room-Management

1 stars 2 forks source link

Approval Process workflow Pending Special Approval Doesn't Handle Deleted Reservations #49

Closed billdeitrick closed 2 days ago

billdeitrick commented 2 months ago

Please go through all the tasks below

Please provide a brief description of the problem. Please do not forget to attach the relevant screenshots from your side.

When a reservation is in the Pending Special Approval state and an Approval Process workflow (using the stock configuration) has been triggered, reservation deletions aren't handled cleanly.

A deleted reservation will cause the workflow to hang due to the now invalid associated reservation and throw errors on every subsequent Process Workflows run.

This is an easy fix by adding a check to the Pending Special Approval workflow action to check for a deleted reservation. I am asking the core plugin add this check to the default approval process workflow.

NOTE: The Room Management version in use here is a couple of versions back, so if this has been resolved in a future plugin release, please close this issue!

Expected Behavior

The Approval Process workflow would handle a deleted reservation cleanly.

Actual Behavior

The approval process workflow does not handle a deleted reservation cleanly if the deletion occurs while the workflow is waiting for the delay in the Pending Special Approval activity to complete.

Steps to Reproduce

Create a reservation that goes to the Pending Special Approval state. Be sure an approval process workflow has been activated and is also in the Pending Special Approval action waiting for the delay to be completed.

Delete the reservation while it is still in the Pending Special Approval state.

Manually complete the delay to force the workflow to process. An error is thrown because the reservation is now invalid.

Rock Version

16.4

Plugin Version

2.4.7.14

Client Culture Setting

en-US

tcavaletto commented 2 months ago

I'll add this to a migration in the next release, but reordering the Special Approval section of the Approval Process workflow to this fixes the issue without any other code or configuration changes: image

tcavaletto commented 2 days ago

Added to next release