lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Dont use `unimplemented!()` macro as it causes federation breakages.

Open Nutomic opened this issue 1 year ago • 0 comments

Requirements

  • [X] Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a single bug? Do not put multiple bugs in one issue.
  • [X] Do you agree to follow the rules in our Code of Conduct?
  • [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

https://github.com/LemmyNet/lemmy/blob/0.19.3/crates/apub/src/activities/block/mod.rs#L79

This code gets called by the federation library here when receiving a ban action in a removed community. Need to replace it with something like the following:

    match apub {
      InstanceOrGroup::Instance(i) => Site::delete(...).await,
      InstanceOrGroup::Group(g) => Instance::delete(...).await,
    }

We should deny the macro via clippy to ensure it isnt used anywhere in the code. Same goes for todo!() macro.

Edit: Specifically InstanceOrGroup should use a macro, such as enum_delegate which is already used elsewhere. Same for PostOrComment and the other ones next to it.

Nutomic avatar Jun 05 '24 21:06 Nutomic