refactor: deduplicate broadcast methods via generic dispatcher #11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
service/broadcast.rshas 11 methods that all follow the same 4-step pattern:get_local_actor()accepted_follower_inboxes()prepare_broadcast()dispatch_deliveries()Inbox deduplication logic is duplicated between
broadcast_create_noteandbroadcast_update_note(lines ~257-271 and ~318-332). Adding a new broadcast method requires copy-pasting 30+ lines.Proposal
Extract a generic broadcast helper parameterized by activity type:
Or a builder pattern:
Files
src/service/broadcast.rs(primary)src/service/delivery.rs(prepare_broadcast, dispatch_deliveries)src/service/follow.rs(uses same dispatch pattern)Trade-offs