LemmyNet/lemmy

[Bug]: Remote moderation, adding and removing mods not possible in 0.19.3

poVoq opened this issue · 2 comments

Requirements

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

Summary

I am trying to add and remove moderators from this community: https://lemmy.ml/c/linuxphones from my account on slrpnk.net

This currently silently fails in lemmy-ui even though UI-wise the option is available and seems to work.

Steps to Reproduce

  1. Try to add a moderator from remote instance
  2. Do the usual steps
  3. no moderator added

Technical Details

When I try it with the Photon UI that gives better error feedback, the return message it shows is:

{"message":"{\"error\":\"not_a_moderator\"}"}

Which is odd as it clearly recognizes me as a moderator otherwise.

Version

BE 0.19.3

Lemmy Instance URL

lemmy.ml and slrpnk.net

@Nutomic this must be the error its hitting: https://github.com/LemmyNet/lemmy/blob/main/crates/apub/src/activities/mod.rs#L124

I'm guessing the check on L120 right above that needs to be removed.

If povoq is a mod of the community, it should already return true in line 114. It shouldnt even reach line 120 in the case described here. That check is only needed to federate actions of admins that are on the same instance as the community (as we dont federate admin status, we allow any user from that instance to perform mod actions).

To resolve this issue its best to write an api test, and add some debug statements to figure out where and why exactly it is failing.