Skip to content

feat(user): implement delete_status with Delete(Note) dispatch#86

Merged
veeso merged 3 commits intomainfrom
feat/19-wi-1-8-implement-user-canister-delete-status
May 4, 2026
Merged

feat(user): implement delete_status with Delete(Note) dispatch#86
veeso merged 3 commits intomainfrom
feat/19-wi-1-8-implement-user-canister-delete-status

Conversation

@veeso
Copy link
Copy Markdown
Owner

@veeso veeso commented May 4, 2026

Summary

  • Owner-only delete_status removes a local status, cascades cleanup of feed/boost/liked plus the FK cascade on statuses, and emits Delete(Note) to followers (blocked actors skipped).
  • Receive side: handle_delete purges inbox rows + feed entries referencing the deleted URI via a new InboxActivityRepository. Matches boost rows by original_status_uri and Create rows by JsonFilter on object.id — both full-URI and bare-snowflake shapes (anchored by activity actor).
  • DID: DeleteStatusArgs.status_uri, error becomes {NotFound, InvalidUri, Internal(String)}.

Closes #19. Issue #20 updated to fold in the moderator-driven moderate_delete_status path (separate inspect arms on directory + user, suspended-bypass for moderator path, owner-only rate limit).

Test plan

  • just check_code (fmt + clippy -D warnings)
  • just build_all
  • cargo test -p user --lib (361 passing)
  • just integration_testtests/delete_status.rs covers owner delete + follower feed purge, idempotent receive, NotFound, InvalidUri

veeso added 3 commits May 4, 2026 21:57
Owner-only delete_status removes a local status, cascades cleanup of
feed/boost/liked rows alongside the FK cascade on `statuses` (media,
edit_history, status_hashtags, pinned_statuses), and emits a
`Delete(Note)` activity to followers (excluding blocked actors).

Receive side: `handle_delete` purges inbox rows referencing the deleted
URI plus their feed entries via a new `InboxActivityRepository`. Matching
covers boost rows by `original_status_uri` and Create rows via JsonFilter
on `object.id` — both the full-URI shape and the bare-snowflake shape
Mastic's current publish pipeline emits, anchored by the activity actor.

DID args switch from `status_id` to `status_uri`; error variant becomes
`{NotFound, InvalidUri, Internal(String)}`.

Closes #19
Break the 1535-line handle_incoming.rs into a parent file holding only
the dispatch + shared helpers, plus one submodule per ActivityPub verb
(create, follow, like, announce, delete, undo). Tests and JSON builders
move alongside the handlers they exercise; shared builders live in
test_helpers.rs.
Move every per-domain `repository.rs` to `src/repository/<name>.rs` in
both user and directory canisters, exposed via a top-level
`crate::repository` module. Domain modules now hold only flow logic and
import repositories with `use crate::repository::<name>::FooRepository;`.
Drop the empty `domain::block` and `domain::tombstone` modules.

Update CLAUDE.md with the new repository convention: all repos live
under `crate::repository` and must implement `db_utils::repository::Repository`.
@veeso veeso merged commit 0aba728 into main May 4, 2026
2 of 3 checks passed
@veeso veeso deleted the feat/19-wi-1-8-implement-user-canister-delete-status branch May 4, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WI-1.8: Implement User Canister - delete status

1 participant