1b7ebe7
ZhenYi
feat(api): phase3e sessions/{id}+is_current, devices, access-key patch/rotate, notification filters+batch read, space @me join/leave
1b7ebe7
use std::error::Error;
use crate::sync::event::PostReceiveTask;
#[async_trait::async_trait]
pub trait WebhookTx: Send + Sync {
async fn dispatch(&self, task: &PostReceiveTask) -> Result<(), Box<dyn Error + Send + Sync>>;
}
#[derive(Debug, Default, Clone)]
pub struct NoopWebhookTx;
#[async_trait::async_trait]
impl WebhookTx for NoopWebhookTx {
async fn dispatch(&self, task: &PostReceiveTask) -> Result<(), Box<dyn Error + Send + Sync>> {
tracing::warn!(
task_id = %task.id,
repo_id = %task.repo_id,
refs = task.refs.len(),
"webhook dispatch not configured; message dropped (NoopWebhookTx)"
);
Ok(())
}
}