lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Incoming Undo from federation doesn't work with link

Open vpzomtrrfrt opened this issue 2 years ago • 1 comments

Issue Summary

Lemmy doesn't appear to accept Undo activities with links as object.

Example object from lotide:

{
  "actor": "http://ltthostname.local:3334/apub/users/3",
  "object": "http://ltthostname.local:3334/apub/communities/5/followers/3",
  "to": "http://localhost:8536/c/hmm",
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "http://ltthostname.local:3334/apub/community_follow_undos/cd6a8d03-9af3-4837-ad21-c3ba0552ff48",
  "type": "Undo"
}

Steps to Reproduce

  1. Follow a Lemmy community from lotide
  2. Unfollow the community
  3. The undo fails to federate, and the Lemmy instance continues to send posts from the community

Technical details

  • Please post your log: sudo docker-compose logs > lemmy_log.out.
2022-02-23T18:05:28.540923Z  INFO actix_web::middleware::logger: 127.0.0.1 "POST /inbox HTTP/1.1" 400 108 "-" "-" 0.061715
2022-02-23T18:05:28.562166Z  INFO HTTP request{http.method=POST http.scheme="http" http.host=localhost:8536 http.target=/c/hmm/inbox otel.kind="server" request_id=52f65f70-e570-4527-9f5d-2f036747550c}:community_inbox: lemmy_apub::http::community: Received community inbox a
ctivity {"actor":"http://ltthostname.local:3334/apub/users/3","object":"http://ltthostname.local:3334/apub/communities/5/followers/3","to":"http://localhost:8536/c/hmm","@context":"https://www.w3.org/ns/activitystreams","id":"http://ltthostname.local:3334/apub/community_fo
llow_undos/cd6a8d03-9af3-4837-ad21-c3ba0552ff48","type":"Undo"}
2022-02-23T18:05:28.567316Z  WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: data did not match any variant of untagged enum GroupInboxActivities at line 1 column 328
   0: lemmy_apub::http::community::community_inbox
             at crates/apub/src/http/community.rs:60
   1: lemmy_server::root_span_builder::HTTP request
           with http.method=POST http.scheme="http" http.host=localhost:8536 http.target=/c/hmm/inbox otel.kind="server" request_id=52f65f70-e570-4527-9f5d-2f036747550c http.status_code=400 otel.status_code="OK"
             at src/root_span_builder.rs:16
   2: tokio::task::runtime.spawn
           with kind=local task.name= loc.file="/home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22
             at /home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
   3: tokio::task::runtime.spawn
           with kind=local task.name= loc.file="/home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22
             at /home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
   4: tokio::task::runtime.spawn
           with kind=local task.name= loc.file="/home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22
             at /home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
   5: tokio::task::runtime.spawn
           with kind=local task.name= loc.file="/home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22
             at /home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
   6: tokio::task::runtime.spawn
           with kind=block_on task.name= loc.file="/home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=466 loc.col=12
             at /home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
LemmyError { message: None, inner: data did not match any variant of untagged enum GroupInboxActivities at line 1 column 328, context: "SpanTrace" }
2022-02-23T18:05:28.567773Z  INFO actix_web::middleware::logger: 127.0.0.1 "POST /c/hmm/inbox HTTP/1.1" 400 89 "-" "-" 0.008592
  • What OS are you trying to install lemmy on? Arch Linux
  • Any browser console errors? n/a

vpzomtrrfrt avatar Feb 23 '22 18:02 vpzomtrrfrt

Right, have to use IdOrNestedObject for that as well (and probably in many other places). Probably easiest if it has methods as_id() and as_object(), to avoid major changes to the code.

Nutomic avatar Feb 24 '22 16:02 Nutomic

This can also be reproduced by following and then unfollowing a community from microblog.pub.

IsaacSchemm avatar Nov 16 '23 22:11 IsaacSchemm