lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Question: HTTP error 400 when trying do Undo Follow

Open zoggy opened this issue 1 year ago • 6 comments

Question

Hello,

I hope this is the right place and category to post. I'm developing an activitypub server and tries to interact with exiting ones.

I can send Follow request and receive Accept, for example from https://lemmy.world/c/fediverse .

But when I send an Undo to unfollow this community, I get a HTTP 400 error with no additional error message.

Here is the json that my servers tries to post to https://lemmy.world/c/fediverse/inbox. It send an Undo activity with the previous Follow activity as object:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "to": [
    "https://lemmy.world/c/fediverse"
  ],
  "published": "2023-12-22T10:16:23-00:00",
  "object": {
    "to": [
      "https://lemmy.world/c/fediverse"
    ],
    "published": "2023-12-22T09:05:45-00:00",
    "object": "https://lemmy.world/c/fediverse",
    "actor": "https://taps.good-eris.net/actors/zoggy",
    "type": "Follow",
    "id": "https://taps.good-eris.net/actors/zoggy/outbox/1703235945766700506210"
  },
  "actor": "https://taps.good-eris.net/actors/zoggy",
  "type": "Undo",
  "id": "https://taps.good-eris.net/actors/zoggy/outbox/1703240184381154537201"
}

Am I doing something wrong ?

zoggy avatar Dec 22 '23 12:12 zoggy

I threw that json into the Lemmy tests and it gets parsed without problems. Your actor also gets fetched without problems. Can you try with an instance on the latest version like voyager.lemmy.ml?

Nutomic avatar Dec 22 '23 13:12 Nutomic

Will re-open if it can be recreated on 0.19.1

dessalines avatar Jan 04 '24 18:01 dessalines

I tried to follow https://voyager.lemmy.ml/c/test or https://voyager.lemmy.ml/c/test3 as suggested by @Nutomic, but I received no accept until now. Is there some manual accept ? When my follow will be accepted, I can try to unfollow.

zoggy avatar Jan 08 '24 10:01 zoggy

There's no manual accept, it should send an async accept out directly after. Would need @Nutomic to take a look.

dessalines avatar Jan 09 '24 16:01 dessalines

Here's an activity I'm trying to send to https://lemmy.ml/c/fediverse/inbox:

{
  "@context": [
    "https://w3id.org/security/v1",
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "comments": "as:comments",
      "sensitive": "as:sensitive"
    }
  ],
  "id": "https://microblog.lakora.us/#crowmask-imitator-57435cb4-ee44-447c-a4b1-4c5f3904fa09",
  "type": "Undo",
  "actor": "https://microblog.lakora.us",
  "object": {
    "id": "https://microblog.lakora.us/#crowmask-imitator-aa332465-8987-4dce-852d-985126050ab2",
    "type": "Follow",
    "actor": "https://microblog.lakora.us",
    "object": "https://lemmy.ml/c/fediverse",
    "published": "2024-01-13T17:22:04.1254006+00:00"
  },
  "published": "2024-01-13T17:30:18.7233821+00:00"
}

This returns an HTTP 400 with the response:

{"error":"unknown","message":""}

The original Follow worked (HTTP 200) with the same signing key.

This may be the same as #2106.

IsaacSchemm avatar Jan 13 '24 17:01 IsaacSchemm

Is the object.id of your Undo/Follow identical to the id of the original follow? In that case its fixed by https://github.com/LemmyNet/lemmy/pull/4364

#2106 is unrelated.

Nutomic avatar Jan 15 '24 10:01 Nutomic