refactor: remove SocialQueryPort — replaced by SocialQuery + FederationAdminQuery

-319 lines. Legacy SocialQueryPort trait, NoopSocialQueryPort,
PanicSocialQueryPort all deleted. Federation repos now implement
FederationAdminQuery (single method). get_users uses FederationAdminQuery.
All other consumers use unified SocialQuery.
This commit is contained in:
2026-07-10 16:02:27 +02:00
parent 7cfa234902
commit 44d7df33a2
19 changed files with 32 additions and 319 deletions

View File

@@ -94,38 +94,18 @@ impl super::SocialQuery for NoopSocialQuery {
async fn get_accepted_following_urls(&self, _: &UserId) -> Result<Vec<String>, DomainError> {
Ok(vec![])
}
async fn list_all_followed_remote_actors(
&self,
) -> Result<Vec<crate::models::RemoteActorInfo>, DomainError> {
Ok(vec![])
}
}
// ── NoopSocialQueryPort ───────────────────────────────────────────────────────
// ── NoopFederationAdminQuery ─────────────────────────────────────────────────
/// Stub used when federation is disabled — returns empty results.
pub struct NoopSocialQueryPort;
pub struct NoopFederationAdminQuery;
#[async_trait]
impl super::SocialQueryPort for NoopSocialQueryPort {
async fn get_accepted_following_urls(&self, _: &UserId) -> Result<Vec<String>, DomainError> {
Ok(vec![])
}
impl super::FederationAdminQuery for NoopFederationAdminQuery {
async fn list_all_followed_remote_actors(
&self,
) -> Result<Vec<crate::models::RemoteActorInfo>, DomainError> {
Ok(vec![])
}
async fn count_following(&self, _: &UserId) -> Result<usize, DomainError> {
Ok(0)
}
async fn count_accepted_followers(&self, _: &UserId) -> Result<usize, DomainError> {
Ok(0)
}
async fn get_pending_followers(
&self,
_: &UserId,
) -> Result<Vec<crate::models::PendingFollowerInfo>, DomainError> {
Ok(vec![])
}
}

View File

@@ -4,7 +4,7 @@ use chrono::NaiveDateTime;
use crate::{
errors::DomainError,
models::{
DiaryEntry, FederationFlags, PendingFollowerInfo, RemoteActorInfo, RemoteGoalEntry,
DiaryEntry, FederationFlags, RemoteActorInfo, RemoteGoalEntry,
RemoteWatchlistEntry, WatchlistWithMovie,
},
value_objects::{MovieId, SocialActor, SocialIdentity, UserId},
@@ -94,26 +94,11 @@ pub trait SocialQuery: Send + Sync {
user_id: &UserId,
) -> Result<Vec<String>, DomainError>;
async fn list_all_followed_remote_actors(
&self,
) -> Result<Vec<crate::models::RemoteActorInfo>, DomainError>;
}
// ── Legacy ports (pre-unification, still used by AP adapter + handlers) ─────
#[async_trait]
pub trait SocialQueryPort: Send + Sync {
async fn get_accepted_following_urls(
&self,
user_id: &UserId,
) -> Result<Vec<String>, DomainError>;
pub trait FederationAdminQuery: Send + Sync {
async fn list_all_followed_remote_actors(&self) -> Result<Vec<RemoteActorInfo>, DomainError>;
async fn count_following(&self, user_id: &UserId) -> Result<usize, DomainError>;
async fn count_accepted_followers(&self, user_id: &UserId) -> Result<usize, DomainError>;
async fn get_pending_followers(
&self,
user_id: &UserId,
) -> Result<Vec<PendingFollowerInfo>, DomainError>;
}
#[async_trait]