Skip to content

Visibility: check Tombstone objects in visible_for_user?/2

Alex Gleason requested to merge object-tombstone-visibility into develop

Fixes the following error:

Jul 27 09:37:43 frontend.poa.st mix[2020728]: Server: poa.st:80 (http)
Jul 27 09:37:43 frontend.poa.st mix[2020728]: Request: GET /objects/ce4dc58c-0688-4cd4-ba76-fbe109f2805a
Jul 27 09:37:43 frontend.poa.st mix[2020728]: ** (exit) an exception was raised:
Jul 27 09:37:43 frontend.poa.st mix[2020728]:     ** (ArgumentError) argument error
Jul 27 09:37:43 frontend.poa.st mix[2020728]:         :erlang.++(nil, [])
Jul 27 09:37:43 frontend.poa.st mix[2020728]:         (pleroma 2.3.0-103-g060ee788-develop) lib/pleroma/web/activity_pub/visibility.ex:85: Pleroma.Web.ActivityPub.Visibility.visible_for_user?/2
Jul 27 09:37:43 frontend.poa.st mix[2020728]:         (pleroma 2.3.0-103-g060ee788-develop) lib/pleroma/web/activity_pub/activity_pub_controller.ex:86: Pleroma.Web.ActivityPub.ActivityPubController.object/2
Jul 27 09:37:43 frontend.poa.st mix[2020728]:         (pleroma 2.3.0-103-g060ee788-develop) lib/pleroma/web/activity_pub/activity_pub_controller.ex:5: Pleroma.Web.ActivityPub.ActivityPubController.action/2
Jul 27 09:37:43 frontend.poa.st mix[2020728]:         (pleroma 2.3.0-103-g060ee788-develop) lib/pleroma/web/activity_pub/activity_pub_controller.ex:5: Pleroma.Web.ActivityPub.ActivityPubController.phoenix_controller_pipeline/2
Jul 27 09:37:43 frontend.poa.st mix[2020728]:         (pleroma 2.3.0-103-g060ee788-develop) lib/pleroma/web/o_status/o_status_controller.ex:5: Pleroma.Web.OStatus.OStatusController.action/2
Jul 27 09:37:43 frontend.poa.st mix[2020728]:         (pleroma 2.3.0-103-g060ee788-develop) lib/pleroma/web/o_status/o_status_controller.ex:5: Pleroma.Web.OStatus.OStatusController.phoenix_controller_pipeline/2
Jul 27 09:37:43 frontend.poa.st mix[2020728]:         (phoenix 1.5.6) lib/phoenix/router.ex:352: Phoenix.Router.__call__/2

We are already doing a similar check on Tombstones in is_public?/1 above. The same thing is needed for visible_for_user?/2, otherwise it attempts to fetch nonexistent keys from the object data.

Merge request reports