use crate::{
recorded_commands,
update_validation::{
UpdateRejection, UPDATE_VALIDATION_WORKER_FAILED, UPDATE_VALIDATOR_REJECTED,
},
ActivityContext, ActivityHandler, AvroValue, Error, QueryTask, QueryTaskExecutionFailure,
Result, Value, Worker, WorkflowIdentity, WorkflowReplayState, WorkflowTask,
WorkflowTaskDecision,
};
use std::{
fmt,
future::Future,
pin::Pin,
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
Arc, Mutex,
},
};
pub type InterceptorFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
pub trait WorkerInterceptor: Send + Sync + 'static {
fn execute_workflow_task<'a>(
&'a self,
context: &'a WorkflowTaskInterceptorContext,
next: WorkflowTaskNext<'a>,
) -> InterceptorFuture<'a, Result<WorkflowTaskOutcome>> {
let _ = context;
next.run()
}
fn execute_activity(
&self,
context: ActivityInterceptorContext,
next: ActivityNext,
) -> InterceptorFuture<'_, Result<AvroValue>> {
next.run(context)
}
fn execute_query_task<'a>(
&'a self,
context: &'a QueryTaskInterceptorContext,
next: QueryTaskNext<'a>,
) -> InterceptorFuture<'a, std::result::Result<AvroValue, QueryTaskFailure>> {
let _ = context;
next.run()
}
fn execute_update_validation_task<'a>(
&'a self,
context: &'a UpdateValidationInterceptorContext,
next: UpdateValidationNext<'a>,
) -> InterceptorFuture<'a, Result<UpdateValidationOutcome>> {
let _ = context;
next.run()
}
}
impl<T: WorkerInterceptor + ?Sized> WorkerInterceptor for Arc<T> {
fn execute_workflow_task<'a>(
&'a self,
context: &'a WorkflowTaskInterceptorContext,
next: WorkflowTaskNext<'a>,
) -> InterceptorFuture<'a, Result<WorkflowTaskOutcome>> {
(**self).execute_workflow_task(context, next)
}
fn execute_activity(
&self,
context: ActivityInterceptorContext,
next: ActivityNext,
) -> InterceptorFuture<'_, Result<AvroValue>> {
(**self).execute_activity(context, next)
}
fn execute_query_task<'a>(
&'a self,
context: &'a QueryTaskInterceptorContext,
next: QueryTaskNext<'a>,
) -> InterceptorFuture<'a, std::result::Result<AvroValue, QueryTaskFailure>> {
(**self).execute_query_task(context, next)
}
fn execute_update_validation_task<'a>(
&'a self,
context: &'a UpdateValidationInterceptorContext,
next: UpdateValidationNext<'a>,
) -> InterceptorFuture<'a, Result<UpdateValidationOutcome>> {
(**self).execute_update_validation_task(context, next)
}
}
#[derive(Clone, Copy, Debug, Default)]
pub struct PassthroughWorkerInterceptor;
impl WorkerInterceptor for PassthroughWorkerInterceptor {}
#[derive(Clone)]
pub(crate) struct RegisteredInterceptor {
name: &'static str,
interceptor: Arc<dyn WorkerInterceptor>,
}
impl RegisteredInterceptor {
pub(crate) fn new<I: WorkerInterceptor>(interceptor: I) -> Self {
Self {
name: std::any::type_name::<I>(),
interceptor: Arc::new(interceptor),
}
}
}
impl fmt::Debug for RegisteredInterceptor {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.name)
}
}
#[derive(Clone, Debug)]
pub struct WorkflowTaskInterceptorContext {
worker_id: String,
task_queue: String,
namespace: String,
task_id: String,
workflow_id: Option<String>,
run_id: Option<String>,
workflow_type: String,
attempt: u64,
history_event_count: usize,
total_history_events: Option<u64>,
history_size_bytes: Option<u64>,
cancel_requested: bool,
observability_context: Option<Value>,
replay_state: WorkflowReplayState,
}
impl WorkflowTaskInterceptorContext {
pub fn worker_id(&self) -> &str {
&self.worker_id
}
pub fn task_queue(&self) -> &str {
&self.task_queue
}
pub fn namespace(&self) -> &str {
&self.namespace
}
pub fn task_id(&self) -> &str {
&self.task_id
}
pub fn workflow_id(&self) -> Option<&str> {
self.workflow_id.as_deref()
}
pub fn run_id(&self) -> Option<&str> {
self.run_id.as_deref()
}
pub fn workflow_type(&self) -> &str {
&self.workflow_type
}
pub fn attempt(&self) -> u64 {
self.attempt
}
pub fn history_event_count(&self) -> usize {
self.history_event_count
}
pub fn total_history_events(&self) -> Option<u64> {
self.total_history_events
}
pub fn history_size_bytes(&self) -> Option<u64> {
self.history_size_bytes
}
pub fn cancel_requested(&self) -> bool {
self.cancel_requested
}
pub fn observability_context(&self) -> Option<&Value> {
self.observability_context.as_ref()
}
pub fn replay_state(&self) -> WorkflowReplayState {
self.replay_state
}
}
#[derive(Clone, Debug)]
pub struct WorkflowTaskOutcome {
commands: Option<Arc<Vec<Value>>>,
}
impl WorkflowTaskOutcome {
pub fn commands(&self) -> &[Value] {
self.commands.as_deref().map_or(&[], Vec::as_slice)
}
pub fn is_lease_lost(&self) -> bool {
self.commands.is_none()
}
}
#[derive(Clone)]
pub struct WorkflowTaskFailure(Arc<FailureView>);
struct FailureView {
kind: String,
message: String,
debug: String,
}
impl WorkflowTaskFailure {
fn describe(error: &Error) -> Self {
let debug = format!("{error:?}");
let kind = debug
.split(|c: char| !(c.is_alphanumeric() || c == '_'))
.next()
.unwrap_or_default()
.to_owned();
Self(Arc::new(FailureView {
kind,
message: error.to_string(),
debug,
}))
}
pub fn kind(&self) -> &str {
&self.0.kind
}
pub fn message(&self) -> &str {
&self.0.message
}
pub fn debug(&self) -> &str {
&self.0.debug
}
}
impl fmt::Debug for WorkflowTaskFailure {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.0.debug)
}
}
impl fmt::Display for WorkflowTaskFailure {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.0.message)
}
}
impl std::error::Error for WorkflowTaskFailure {}
type WorkflowCoreResult = Result<Option<WorkflowTaskDecision>>;
enum CoreRecord {
Completed {
decision: WorkflowTaskDecision,
commands: Arc<Vec<Value>>,
},
LeaseLost,
Failed(Error),
}
struct WorkflowCore<'a> {
future: InterceptorFuture<'a, WorkflowCoreResult>,
record: &'a Mutex<Option<CoreRecord>>,
started: &'a AtomicBool,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) enum CoreProgress {
NotStarted,
Abandoned,
Completed,
}
pub struct WorkflowTaskNext<'a> {
chain: &'a [RegisteredInterceptor],
index: usize,
reached: &'a AtomicUsize,
context: &'a WorkflowTaskInterceptorContext,
core: WorkflowCore<'a>,
}
impl<'a> WorkflowTaskNext<'a> {
pub fn run(self) -> InterceptorFuture<'a, Result<WorkflowTaskOutcome>> {
if let Some(registered) = self.chain.get(self.index) {
let (reached, index) = (self.reached, self.index);
let next = WorkflowTaskNext {
index: self.index + 1,
..self
};
let hook = registered
.interceptor
.execute_workflow_task(next.context, next);
return Box::pin(async move {
reached.fetch_max(index, Ordering::SeqCst);
hook.await
});
}
let WorkflowCore {
future,
record,
started,
} = self.core;
Box::pin(async move {
started.store(true, Ordering::SeqCst);
let (stored, outcome) = match future.await {
Ok(Some(mut decision)) => {
let commands = Arc::new(std::mem::take(&mut decision.commands));
let outcome = WorkflowTaskOutcome {
commands: Some(commands.clone()),
};
(CoreRecord::Completed { decision, commands }, Ok(outcome))
}
Ok(None) => (
CoreRecord::LeaseLost,
Ok(WorkflowTaskOutcome { commands: None }),
),
Err(error) => {
let failure = WorkflowTaskFailure::describe(&error);
(
CoreRecord::Failed(error),
Err(Error::WorkflowTaskFailed(failure)),
)
}
};
if let Ok(mut slot) = record.lock() {
*slot = Some(stored);
}
outcome
})
}
}
impl Worker {
pub(crate) fn workflow_task_interceptor_context(
&self,
task: &WorkflowTask,
) -> Option<WorkflowTaskInterceptorContext> {
if self.interceptors.is_empty() {
return None;
}
Some(WorkflowTaskInterceptorContext {
worker_id: self.worker_id.clone(),
task_queue: self.task_queue.clone(),
namespace: self.client.namespace.clone(),
task_id: task.task_id.clone(),
workflow_id: task.workflow_id.clone(),
run_id: task.run_id.clone(),
workflow_type: task.workflow_type.clone(),
attempt: task.workflow_task_attempt,
history_event_count: task.history_events.len(),
total_history_events: task.total_history_events,
history_size_bytes: task.history_size_bytes,
cancel_requested: task.cancel_requested,
observability_context: task.observability_context.clone(),
replay_state: task_replay_state(task),
})
}
pub(crate) async fn intercept_workflow_task<F>(
&self,
context: Option<WorkflowTaskInterceptorContext>,
core: F,
) -> WorkflowCoreResult
where
F: Future<Output = WorkflowCoreResult> + Send,
{
self.intercept_workflow_task_tracked(context, core).await.0
}
pub(crate) async fn intercept_workflow_task_tracked<F>(
&self,
context: Option<WorkflowTaskInterceptorContext>,
core: F,
) -> (WorkflowCoreResult, CoreProgress)
where
F: Future<Output = WorkflowCoreResult> + Send,
{
let Some(context) = context else {
return (core.await, CoreProgress::Completed);
};
let record = Mutex::new(None);
let reached = AtomicUsize::new(0);
let started = AtomicBool::new(false);
let chain = WorkflowTaskNext {
chain: &self.interceptors,
index: 0,
reached: &reached,
context: &context,
core: WorkflowCore {
future: Box::pin(core),
record: &record,
started: &started,
},
}
.run()
.await
.map(drop);
let Some(record) = record.into_inner().ok().flatten() else {
let error = match &chain {
Ok(()) => String::new(),
Err(error) => format!(": {error}"),
};
if started.load(Ordering::SeqCst) {
return (
Err(Error::WorkflowTaskInterceptor(format!(
"a workflow task interceptor dropped the workflow task before it completed{error}"
))),
CoreProgress::Abandoned,
);
}
let skipped = &self.interceptors[reached
.load(Ordering::SeqCst)
.min(self.interceptors.len() - 1)];
let message = match chain {
Ok(()) => format!(
"workflow task interceptor {} returned without running next",
skipped.name
),
Err(_) => format!(
"workflow task interceptor {} failed without running next{error}",
skipped.name
),
};
return (
Err(Error::WorkflowTaskInterceptor(message)),
CoreProgress::NotStarted,
);
};
let result = match record {
CoreRecord::Failed(error) => Err(error),
CoreRecord::LeaseLost => Ok(None),
CoreRecord::Completed {
mut decision,
commands,
} => match chain {
Ok(()) => {
decision.commands =
Arc::try_unwrap(commands).unwrap_or_else(|retained| (*retained).clone());
Ok(Some(decision))
}
Err(error) => Err(Error::WorkflowTaskInterceptor(format!(
"workflow task interceptor failed: {error}"
))),
},
};
(result, CoreProgress::Completed)
}
}
fn task_replay_state(task: &WorkflowTask) -> WorkflowReplayState {
match recorded_commands(
&task.history_events,
&task.payload_codec,
WorkflowIdentity {
workflow_id: task.workflow_id.clone(),
run_id: task.run_id.clone(),
},
) {
Ok(commands) if commands.is_empty() => WorkflowReplayState::Executing,
Ok(_) => WorkflowReplayState::Replaying,
Err(_) => WorkflowReplayState::Unavailable,
}
}
#[derive(Clone, Debug)]
pub struct ActivityInterceptorContext {
activity: ActivityContext,
args: AvroValue,
local: bool,
}
impl ActivityInterceptorContext {
pub fn worker_id(&self) -> &str {
&self.activity.worker_id
}
pub fn task_queue(&self) -> &str {
&self.activity.task_queue
}
pub fn namespace(&self) -> &str {
&self.activity.client.namespace
}
pub fn task_id(&self) -> &str {
&self.activity.task_id
}
pub fn activity_attempt_id(&self) -> &str {
&self.activity.activity_attempt_id
}
pub fn activity_type(&self) -> &str {
&self.activity.activity_type
}
pub fn attempt(&self) -> u64 {
self.activity.attempt_number
}
pub fn workflow_id(&self) -> Option<&str> {
self.activity.workflow_id()
}
pub fn run_id(&self) -> Option<&str> {
self.activity.run_id()
}
pub fn is_local(&self) -> bool {
self.local
}
pub fn args(&self) -> &AvroValue {
&self.args
}
pub fn activity_context(&self) -> &ActivityContext {
&self.activity
}
pub fn with_args(mut self, args: AvroValue) -> Self {
self.args = args;
self
}
}
pub struct ActivityNext {
chain: Arc<[RegisteredInterceptor]>,
index: usize,
handler: ActivityHandler,
}
impl ActivityNext {
pub fn run(
self,
context: ActivityInterceptorContext,
) -> InterceptorFuture<'static, Result<AvroValue>> {
let Some(registered) = self.chain.get(self.index) else {
return (self.handler)(context.activity, context.args);
};
let interceptor = registered.interceptor.clone();
let next = ActivityNext {
index: self.index + 1,
..self
};
Box::pin(async move { interceptor.execute_activity(context, next).await })
}
}
impl fmt::Debug for ActivityNext {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("ActivityNext")
.field(
"remaining",
&&self.chain[self.index.min(self.chain.len())..],
)
.finish()
}
}
pub(crate) fn intercept_activity(
chain: &Arc<[RegisteredInterceptor]>,
handler: &ActivityHandler,
activity: ActivityContext,
args: AvroValue,
local: bool,
) -> InterceptorFuture<'static, Result<AvroValue>> {
if chain.is_empty() {
return handler(activity, args);
}
ActivityNext {
chain: chain.clone(),
index: 0,
handler: handler.clone(),
}
.run(ActivityInterceptorContext {
activity,
args,
local,
})
}
#[derive(Clone, Debug)]
pub struct QueryTaskInterceptorContext {
worker_id: String,
task_queue: String,
namespace: String,
query_task_id: String,
attempt: u64,
workflow_id: Option<String>,
run_id: Option<String>,
workflow_type: String,
query_name: String,
observability_context: Option<Value>,
}
impl QueryTaskInterceptorContext {
pub fn worker_id(&self) -> &str {
&self.worker_id
}
pub fn task_queue(&self) -> &str {
&self.task_queue
}
pub fn namespace(&self) -> &str {
&self.namespace
}
pub fn query_task_id(&self) -> &str {
&self.query_task_id
}
pub fn attempt(&self) -> u64 {
self.attempt
}
pub fn workflow_id(&self) -> Option<&str> {
self.workflow_id.as_deref()
}
pub fn run_id(&self) -> Option<&str> {
self.run_id.as_deref()
}
pub fn workflow_type(&self) -> &str {
&self.workflow_type
}
pub fn query_name(&self) -> &str {
&self.query_name
}
pub fn observability_context(&self) -> Option<&Value> {
self.observability_context.as_ref()
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct QueryTaskFailure {
reason: String,
message: String,
failure_type: String,
}
impl QueryTaskFailure {
pub fn new(
reason: impl Into<String>,
message: impl Into<String>,
failure_type: impl Into<String>,
) -> Self {
Self {
reason: reason.into(),
message: message.into(),
failure_type: failure_type.into(),
}
}
pub fn reason(&self) -> &str {
&self.reason
}
pub fn message(&self) -> &str {
&self.message
}
pub fn failure_type(&self) -> &str {
&self.failure_type
}
}
impl fmt::Display for QueryTaskFailure {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}: {}", self.reason, self.message)
}
}
impl std::error::Error for QueryTaskFailure {}
impl From<QueryTaskExecutionFailure> for QueryTaskFailure {
fn from(failure: QueryTaskExecutionFailure) -> Self {
Self {
reason: failure.reason,
message: failure.message,
failure_type: failure.failure_type,
}
}
}
impl From<QueryTaskFailure> for QueryTaskExecutionFailure {
fn from(failure: QueryTaskFailure) -> Self {
Self {
reason: failure.reason,
message: failure.message,
failure_type: failure.failure_type,
}
}
}
type QueryResult = std::result::Result<AvroValue, QueryTaskFailure>;
pub struct QueryTaskNext<'a> {
chain: &'a [RegisteredInterceptor],
context: &'a QueryTaskInterceptorContext,
core: InterceptorFuture<'a, QueryResult>,
}
impl<'a> QueryTaskNext<'a> {
pub fn run(self) -> InterceptorFuture<'a, QueryResult> {
match self.chain.split_first() {
Some((registered, rest)) => registered.interceptor.execute_query_task(
self.context,
QueryTaskNext {
chain: rest,
..self
},
),
None => self.core,
}
}
}
impl Worker {
pub(crate) fn query_task_interceptor_context(
&self,
task: &QueryTask,
) -> Option<QueryTaskInterceptorContext> {
if self.interceptors.is_empty() {
return None;
}
Some(QueryTaskInterceptorContext {
worker_id: self.worker_id.clone(),
task_queue: self.task_queue.clone(),
namespace: self.client.namespace.clone(),
query_task_id: task.query_task_id.clone(),
attempt: task.query_task_attempt,
workflow_id: task.workflow_id.clone(),
run_id: task.run_id.clone(),
workflow_type: task.workflow_type.clone(),
query_name: task.query_name.clone(),
observability_context: task.observability_context.clone(),
})
}
pub(crate) async fn intercept_query_task<F>(
&self,
context: Option<QueryTaskInterceptorContext>,
core: F,
) -> std::result::Result<AvroValue, QueryTaskExecutionFailure>
where
F: Future<Output = std::result::Result<AvroValue, QueryTaskExecutionFailure>> + Send,
{
let Some(context) = context else {
return core.await;
};
QueryTaskNext {
chain: &self.interceptors,
context: &context,
core: Box::pin(async move { core.await.map_err(QueryTaskFailure::from) }),
}
.run()
.await
.map_err(QueryTaskExecutionFailure::from)
}
}
#[derive(Clone, Debug)]
pub struct UpdateValidationInterceptorContext {
worker_id: String,
task_queue: String,
namespace: String,
update_validation_task_id: String,
attempt: u64,
workflow_id: Option<String>,
run_id: Option<String>,
workflow_type: String,
update_name: String,
observability_context: Option<Value>,
}
impl UpdateValidationInterceptorContext {
pub fn worker_id(&self) -> &str {
&self.worker_id
}
pub fn task_queue(&self) -> &str {
&self.task_queue
}
pub fn namespace(&self) -> &str {
&self.namespace
}
pub fn update_validation_task_id(&self) -> &str {
&self.update_validation_task_id
}
pub fn attempt(&self) -> u64 {
self.attempt
}
pub fn workflow_id(&self) -> Option<&str> {
self.workflow_id.as_deref()
}
pub fn run_id(&self) -> Option<&str> {
self.run_id.as_deref()
}
pub fn workflow_type(&self) -> &str {
&self.workflow_type
}
pub fn update_name(&self) -> &str {
&self.update_name
}
pub fn observability_context(&self) -> Option<&Value> {
self.observability_context.as_ref()
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct UpdateValidationOutcome {
rejection: Option<(&'static str, UpdateRejection)>,
}
impl UpdateValidationOutcome {
pub fn is_approved(&self) -> bool {
self.rejection.is_none()
}
pub fn is_rejected(&self) -> bool {
matches!(self.rejection, Some((UPDATE_VALIDATOR_REJECTED, _)))
}
pub fn is_worker_failure(&self) -> bool {
matches!(self.rejection, Some((UPDATE_VALIDATION_WORKER_FAILED, _)))
}
pub fn reason(&self) -> Option<&str> {
self.rejection.as_ref().map(|(reason, _)| *reason)
}
pub fn rejection(&self) -> Option<&UpdateRejection> {
self.rejection.as_ref().map(|(_, rejection)| rejection)
}
}
pub(crate) type ValidationDecision = std::result::Result<(), (&'static str, UpdateRejection)>;
struct ValidationCore<'a> {
future: InterceptorFuture<'a, ValidationDecision>,
record: &'a Mutex<Option<ValidationDecision>>,
started: &'a AtomicBool,
}
pub struct UpdateValidationNext<'a> {
chain: &'a [RegisteredInterceptor],
index: usize,
reached: &'a AtomicUsize,
context: &'a UpdateValidationInterceptorContext,
core: ValidationCore<'a>,
}
impl<'a> UpdateValidationNext<'a> {
pub fn run(self) -> InterceptorFuture<'a, Result<UpdateValidationOutcome>> {
if let Some(registered) = self.chain.get(self.index) {
let (reached, index) = (self.reached, self.index);
let next = UpdateValidationNext {
index: self.index + 1,
..self
};
let hook = registered
.interceptor
.execute_update_validation_task(next.context, next);
return Box::pin(async move {
reached.fetch_max(index, Ordering::SeqCst);
hook.await
});
}
let ValidationCore {
future,
record,
started,
} = self.core;
Box::pin(async move {
started.store(true, Ordering::SeqCst);
let decision = future.await;
let outcome = UpdateValidationOutcome {
rejection: decision.clone().err(),
};
if let Ok(mut slot) = record.lock() {
*slot = Some(decision);
}
Ok(outcome)
})
}
}
impl Worker {
pub(crate) fn update_validation_interceptor_context(
&self,
task: &Value,
) -> Option<UpdateValidationInterceptorContext> {
if self.interceptors.is_empty() {
return None;
}
let text = |field: &str| task[field].as_str().map(str::to_string);
Some(UpdateValidationInterceptorContext {
worker_id: self.worker_id.clone(),
task_queue: self.task_queue.clone(),
namespace: self.client.namespace.clone(),
update_validation_task_id: text("update_validation_task_id").unwrap_or_default(),
attempt: task["update_validation_attempt"].as_u64().unwrap_or(1),
workflow_id: text("workflow_id"),
run_id: text("run_id"),
workflow_type: text("workflow_type").unwrap_or_default(),
update_name: text("update_name").unwrap_or_default(),
observability_context: task
.get("observability_context")
.filter(|value| !value.is_null())
.cloned(),
})
}
pub(crate) async fn intercept_update_validation<F>(
&self,
context: Option<UpdateValidationInterceptorContext>,
core: F,
) -> ValidationDecision
where
F: Future<Output = ValidationDecision> + Send,
{
let Some(context) = context else {
return core.await;
};
let record = Mutex::new(None);
let reached = AtomicUsize::new(0);
let started = AtomicBool::new(false);
let chain = UpdateValidationNext {
chain: &self.interceptors,
index: 0,
reached: &reached,
context: &context,
core: ValidationCore {
future: Box::pin(core),
record: &record,
started: &started,
},
}
.run()
.await
.map(drop);
let failed = |message: String| {
Err((
UPDATE_VALIDATION_WORKER_FAILED,
UpdateRejection::new(message).with_type("UpdateValidationInterceptor"),
))
};
let Some(decision) = record.into_inner().ok().flatten() else {
let error = match &chain {
Ok(()) => String::new(),
Err(error) => format!(": {error}"),
};
if started.load(Ordering::SeqCst) {
return failed(format!(
"an update validation interceptor dropped the validation before it completed{error}"
));
}
let skipped = &self.interceptors[reached
.load(Ordering::SeqCst)
.min(self.interceptors.len() - 1)];
return failed(match chain {
Ok(()) => format!(
"update validation interceptor {} returned without running next",
skipped.name
),
Err(_) => format!(
"update validation interceptor {} failed without running next{error}",
skipped.name
),
});
};
match chain {
Ok(()) => decision,
Err(error) => failed(format!("update validation interceptor failed: {error}")),
}
}
}