Preload all details from actor when refreshing it
22:26:49.851 request_id=Fs97WK_ZepZklT8ABL-h [info] GET /@attac63@mobilizon.fr
22:26:59.945 request_id=Fs97WK_ZepZklT8ABL-h [info] Sent 500 in 10093ms
22:26:59.946 [error] #PID<0.7229.3> running Mobilizon.Web.Endpoint (connection #PID<0.7160.3>, stream id 4) terminated
Server: keskonfai.fr:80 (http)
Request: GET /@attac63@mobilizon.fr
** (exit) an exception was raised:
** (Phoenix.Template.UndefinedError) Could not render "address.json" for Mobilizon.Web.JsonLD.ObjectView, please define a matching clause for render/2 or define a template at "lib/web/templates/json_ld/object/**/*". No templates were compiled for this module.
Assigns:
%{address: #Ecto.Association.NotLoaded<association :physical_address is not loaded>, as: :address}
Assigned keys: [:address, :as]
(phoenix_view 1.1.0) lib/phoenix/template.ex:374: Phoenix.Template.raise_template_not_found/3
(mobilizon 2.0.2) lib/web/views/json_ld/object_view.ex:36: Mobilizon.Web.JsonLD.ObjectView.render/2
(mobilizon 2.0.2) lib/service/metadata/actor.ex:131: Mobilizon.Service.Metadata.Mobilizon.Actors.Actor.json/1
(mobilizon 2.0.2) lib/service/metadata/actor.ex:79: Mobilizon.Service.Metadata.Mobilizon.Actors.Actor.add_group_schema/2
(mobilizon 2.0.2) lib/service/metadata/actor.ex:43: Mobilizon.Service.Metadata.Mobilizon.Actors.Actor.build_tags/2
(mobilizon 2.0.2) lib/web/views/page_view.ex:69: Mobilizon.Web.PageView.render/2
(phoenix_view 1.1.0) lib/phoenix/view.ex:473: Phoenix.View.render_to_iodata/3
(phoenix 1.6.6) lib/phoenix/controller.ex:772: Phoenix.Controller.render_and_send/4
This is because not all values returned by Mobilizon.Federation.ActivityPub.Actor.find_or_make_actor_from_nickname/1
return an actor with all needed relations preloaded.
Replacing
Repo.preload(actor, [:followers])
with
Repo.preload(actor, [:followers, :physical_address])
(or probably more missing relations) should fix it.