Can't get /favourited_by for some statuses
When a status has likes with type "OrderedCollection" instead of an array, the %Ecto.Query.CastError
error is raised on /api/v1/statuses/:id/favourited_by
endpoint.
Example status: https://pleroma.broccoli.si/notice/9lUH6vLYGbB8Jvok8u
Its likes:
"likes": {
"type": "OrderedCollection",
"totalItems": 3,
"id": "https://pleroma.soykaf.com/objects/da6e25e6-c7bd-4a29-bd83-ddf50800eaa6/likes",
"first": "https://pleroma.soykaf.com/objects/da6e25e6-c7bd-4a29-bd83-ddf50800eaa6/likes?page=1"
}
Error message on https://pleroma.broccoli.si/api/v1/statuses/9lUH6vLYGbB8Jvok8u/favourited_by:
[error] Internal server error: %Ecto.Query.CastError{message: "/tmp/build/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex:891: value `%{\"first\" => \"https://pleroma.soykaf.com/objects/da6e25e6-c7bd-4a29-bd83-ddf50800eaa6/likes?page=1\", \"id\" => \"https://pleroma.soykaf.com/objects/da6e25e6-c7bd-4a29-bd83-ddf50800eaa6/likes\", \"totalItems\" => 3, \"type\" => \"OrderedCollection\"}` in `where` cannot be cast to type {:in, :string} in query:\n\nfrom u0 in Pleroma.User,\n where: u0.ap_id in ^%{\"first\" => \"https://pleroma.soykaf.com/objects/da6e25e6-c7bd-4a29-bd83-ddf50800eaa6/likes?page=1\", \"id\" => \"https://pleroma.soykaf.com/objects/da6e25e6-c7bd-4a29-bd83-ddf50800eaa6/likes\", \"totalItems\" => 3, \"type\" => \"OrderedCollection\"},\n select: u0\n", type: {:in, :string}, value: %{"first" => "https://pleroma.soykaf.com/objects/da6e25e6-c7bd-4a29-bd83-ddf50800eaa6/likes?page=1", "id" => "https://pleroma.soykaf.com/objects/da6e25e6-c7bd-4a29-bd83-ddf50800eaa6/likes", "totalItems" => 3, "type" => "OrderedCollection"}}
The same status on its original instance works well: https://pleroma.soykaf.com/notice/9lUFLyXLJ29OaAwNJw