Lock validation exposed to the projection executor (CB-8B).
(
&self,
operation_lock: &WorkingCopyOperationLockGuard,
operation: &Operation,
)
| 2779 | |
| 2780 | /// Lock validation exposed to the projection executor (CB-8B). |
| 2781 | pub(super) fn validate_projection_lock( |
| 2782 | &self, |
| 2783 | operation_lock: &WorkingCopyOperationLockGuard, |
| 2784 | operation: &Operation, |
| 2785 | ) -> Result<(), RepositoryError> { |
| 2786 | let locked = operation_lock.working_copy(); |
| 2787 | match operation.payload().working_copy { |
| 2788 | Some(operation_working_copy) if operation_working_copy == locked => Ok(()), |
| 2789 | Some(operation_working_copy) => Err(RepositoryError::InvalidOperation { |
| 2790 | message: format!( |
| 2791 | "operation {} belongs to working copy {operation_working_copy}, but lock is for {locked}", |
| 2792 | operation.id() |
| 2793 | ), |
| 2794 | }), |
| 2795 | None => Err(RepositoryError::InvalidOperation { |
| 2796 | message: format!( |
| 2797 | "repository-scoped operation {} cannot use a working-copy recovery lock", |
| 2798 | operation.id() |
| 2799 | ), |
| 2800 | }), |
| 2801 | } |
| 2802 | } |
| 2803 | |
| 2804 | pub(super) fn append_receipt_immediate( |
| 2805 | &self, |
no test coverage detected