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

@@ -1,6 +1,6 @@
use super::*;
use chrono::Utc;
use domain::ports::SocialQueryPort;
use domain::ports::FederationAdminQuery;
use k_ap::ActorRepository;
use sqlx::SqlitePool;
@@ -79,30 +79,6 @@ async fn setup_db(pool: &SqlitePool) {
.unwrap();
}
#[tokio::test]
async fn test_get_accepted_following_urls_returns_only_accepted() {
let pool = SqlitePool::connect(":memory:").await.unwrap();
setup_db(&pool).await;
let repo = SqliteFederationRepository::new(pool.clone());
let user_id = uuid::Uuid::new_v4();
sqlx::query(
"INSERT INTO ap_following (local_user_id, remote_actor_url, follow_activity_id, status)
VALUES (?, 'https://other.social/users/alice', 'act1', 'accepted'),
(?, 'https://other.social/users/bob', 'act2', 'pending')",
)
.bind(user_id.to_string())
.bind(user_id.to_string())
.execute(&pool)
.await
.unwrap();
let uid = domain::value_objects::UserId::from_uuid(user_id);
let urls = repo.get_accepted_following_urls(&uid).await.unwrap();
assert_eq!(urls.len(), 1);
assert_eq!(urls[0], "https://other.social/users/alice");
}
#[tokio::test]
async fn test_list_all_followed_remote_actors_deduplicates() {
let pool = SqlitePool::connect(":memory:").await.unwrap();