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

@@ -116,11 +116,6 @@ impl domain::ports::SocialQuery for FakeSocialWithFollowing {
) -> Result<Vec<String>, DomainError> {
Ok(self.0.clone())
}
async fn list_all_followed_remote_actors(
&self,
) -> Result<Vec<domain::models::RemoteActorInfo>, DomainError> {
Ok(vec![])
}
}
#[tokio::test]

View File

@@ -2,7 +2,7 @@ use std::sync::Arc;
use domain::testing::{
InMemoryGoalRepository, InMemorySocialRepository, InMemoryWrapUpRepository,
InMemoryWrapUpStatsQuery, NoopSocialQueryPort,
InMemoryWrapUpStatsQuery, NoopFederationAdminQuery,
};
use domain::{
ports::{
@@ -75,7 +75,7 @@ pub struct TestContextBuilder {
pub review_logger: Arc<dyn ReviewLogger>,
pub social_command: Arc<dyn domain::ports::SocialCommand>,
pub social_query_unified: Arc<dyn domain::ports::SocialQuery>,
pub social_query: Arc<dyn domain::ports::SocialQueryPort>,
pub federation_admin: Arc<dyn domain::ports::FederationAdminQuery>,
pub refresh_session_repo: Arc<dyn RefreshSessionRepository>,
pub config: AppConfig,
}
@@ -127,7 +127,7 @@ impl TestContextBuilder {
review_logger: Arc::new(NoopReviewLogger),
social_command: Arc::clone(&social) as _,
social_query_unified: Arc::clone(&social) as _,
social_query: Arc::new(NoopSocialQueryPort),
federation_admin: Arc::new(NoopFederationAdminQuery),
refresh_session_repo: InMemoryRefreshSessionRepository::new(),
config: AppConfig {
allow_registration: true,
@@ -273,11 +273,6 @@ impl TestContextBuilder {
self
}
pub fn with_social_query(mut self, r: Arc<dyn domain::ports::SocialQueryPort>) -> Self {
self.social_query = r;
self
}
pub fn with_wrapup_repo(mut self, r: Arc<dyn WrapUpRepository>) -> Self {
self.wrapup_repo = r;
self

View File

@@ -1,7 +1,7 @@
use std::sync::Arc;
use domain::ports::{
DiaryQuery, EventPublisher, ObjectStorage, SocialQuery, SocialQueryPort, StatsRepository,
DiaryQuery, EventPublisher, FederationAdminQuery, ObjectStorage, SocialQuery, StatsRepository,
UserRepository,
};
@@ -13,7 +13,7 @@ pub struct GetProfileDeps {
pub struct GetUsersListDeps {
pub user: Arc<dyn UserRepository>,
pub social_query_legacy: Arc<dyn SocialQueryPort>,
pub federation_admin: Arc<dyn FederationAdminQuery>,
}
pub struct UpdateProfileDeps {

View File

@@ -15,7 +15,7 @@ pub async fn execute(
) -> Result<UsersListData, DomainError> {
let (users_result, actors_result) = tokio::join!(
deps.user.list_with_stats(),
deps.social_query_legacy.list_all_followed_remote_actors()
deps.federation_admin.list_all_followed_remote_actors()
);
Ok(UsersListData {