Commit Graph

22 Commits

Author SHA1 Message Date
84edf58de6 fix(federation): fix 27 AP bugs, gaps, and inconsistencies
Some checks failed
lint / lint (push) Failing after 9m26s
test / unit (push) Successful in 16m3s
Round 1 — 18 bug fixes:
- remote likes/boosts now persist in engagement tables
- intern_remote_actor uses name@domain, expanded username to VARCHAR(255)
- PgRemoteActorRepository upsert/find now handles all fields
- update_following_status no longer a no-op, count_followers counts all
- accept/reject follow publishes event before DB mark (atomicity)
- fetch_outbox_page follows pagination via next links
- actor URL canonicalized to /users/{uuid}
- content_to_html escapes single quotes
- WebFinger accepts application/ld+json type
- try_from_ap accepts Article and Page object types
- feed SQL uses parameterized viewer UUID instead of format!
- content cap raised from 500 to 5000 chars
- also_known_as changed from Option<String> to Vec<String>
- connections fetch always triggers from page 1

Round 2 — 9 gap fixes:
- on_announce_removed handler deletes boost row on Undo(Announce)
- on_update handles Person/Service/Group actor profile updates
- sync_remote_actor_to_user syncs remote_actors → users on create/update
- FederationBlockPort: block_by_username sends Block activity to remote
- domain RemoteActor gains inbox_url, shared_inbox_url fields
- remote_actors attachment column (JSONB) with read/write
- .well-known/host-meta endpoint
- 256KB body limit on AP inbox routes
- outbox cleanup job (7-day retention, hourly sweep)
2026-05-29 11:28:40 +02:00
f9de21dcfa refactor(tests): remove unused value_objects imports from test files
Some checks failed
lint / lint (push) Failing after 9m20s
test / unit (push) Successful in 16m13s
2026-05-29 10:18:18 +02:00
79f1e63bb8 perf(feed): replace correlated subqueries with LEFT JOIN aggregations
Some checks failed
lint / lint (push) Failing after 9m14s
test / unit (push) Successful in 16m3s
Feed queries ran 5 correlated subqueries per row (3 COUNT + 2 EXISTS
for engagement counts and viewer context). Replaced with LEFT JOIN
aggregations computed once per query. Adds migration 016 with indexes
on likes(thought_id), boosts(thought_id), thoughts(in_reply_to_id),
and compound viewer-context indexes — expected to drop ~3s queries to
<100ms on typical page sizes.

Also removes WebFinger from the footer (requires query params, zero
standalone value as a link).
2026-05-29 04:35:32 +02:00
5b4b747dd7 feat(federation): enrich RemoteActor with bio, banner, followers/following URLs
Some checks failed
lint / lint (push) Failing after 9m25s
test / unit (push) Has been cancelled
Bumps k-ap to 0.3.1 which adds bio, banner_url, followers_url,
following_url, and also_known_as to RemoteActor. These are populated
from fetched actor JSON at follow/ingest time so followers and following
listings no longer return null profile fields.

Adds migration 015 for the new remote_actors columns, updates all JOIN
queries in postgres-federation to select and return the new fields, and
maps them through k_ap_actor_to_domain.

Also fixes clippy: remove empty line after doc comment in port.rs.
2026-05-29 04:07:52 +02:00
ecb61f9b8f feat: add federation processed activities table and update dependencies
Some checks failed
test / unit (push) Has been cancelled
lint / lint (push) Has been cancelled
- Created a new SQL migration to add the `federation_processed_activities` table with an index on `processed_at`.
- Updated dependencies in `Cargo.toml` files across `bootstrap` and `worker` crates, including version updates for `k-ap`.
- Enhanced the event publishing mechanism in the `factory.rs` file to include a new `KapPublisher` for handling federation events.
- Refactored the `build` function in `factory.rs` to accommodate the new event publisher and improve ActivityPub service initialization.
- Modified the worker's main loop to handle new federation event types and improved error handling for event processing.

Co-authored-by: Copilot <copilot@github.com>
2026-05-29 03:47:06 +02:00
8229285a2f refactor(postgres): format FeedSqlBuilder for improved readability 2026-05-29 00:13:55 +02:00
145b07d636 refactor(postgres): introduce FeedSqlBuilder to consolidate SQL construction 2026-05-29 00:11:07 +02:00
0688ffe0ae feat(backend): wire FeedRequest/FeedOptions sort+filter through all feed layers 2026-05-28 23:45:46 +02:00
e6330125be test(postgres): add list_mutual integration tests 2026-05-28 03:42:12 +02:00
14b7928026 fix: list_mutual sort by follow created_at, apply pagination in TestStore 2026-05-28 03:40:44 +02:00
a6a555e6a7 feat(domain): add list_mutual to FollowRepository, add remote actor storage to TestStore 2026-05-28 03:37:41 +02:00
75e6fe61ca fix: look up remote parent by ap_id to thread remote-to-remote replies 2026-05-28 02:59:45 +02:00
e338254099 feat(domain): add RemoteFollowAccepted, RemoteFollowRejected, ActorMoved events 2026-05-28 02:19:46 +02:00
2445cad1c9 feat: add PATCH /federation/me/also-known-as endpoint
Adds alsoKnownAs column to users table (migration 013), reads it in
the AP actor JSON, and exposes PATCH /federation/me/also-known-as to
set or clear it. Required pre-condition for broadcast_move.
2026-05-28 01:59:35 +02:00
5097c91261 feat: store AP note extensions in JSONB and render movies-diary posts as rich cards 2026-05-24 04:29:04 +02:00
01932cf337 feat: add image upload for avatar and banner 2026-05-24 02:06:47 +02:00
6936b7ce62 chore: switch activitypub-base to k-ap git dep 2026-05-17 22:47:32 +02:00
d56d34cc27 refactor: replace long arg lists with input/config structs and builder
- Thought::new_local → NewThought struct (7 args → 1)
- UserWriter::update_profile → UpdateProfileInput struct (6 args → 2)
- update_profile use case → UpdateProfileInput (8 args → 3)
- ActivityPubService::new → builder pattern (9 args → 5 required + 4 optional setters)
- accept_note → AcceptNoteInput struct (8 args → 1)
- ThoughtNote::new_public → ThoughtNoteInput struct (8 args → 1)

Remove all #[allow(clippy::too_many_arguments)] annotations.
2026-05-17 12:25:53 +02:00
2c2decba72 clean up 2026-05-17 12:14:45 +02:00
d813e59b5c fmt 2026-05-17 12:04:51 +02:00
a0aa3f381e refactor: extract inline test modules to separate files
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
2026-05-16 12:08:38 +02:00
9aee4ceb6d feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready (#1)
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
2026-05-16 09:42:40 +00:00