Pleroma.Instances.Instance is missing a `on_replace: :update`
iex(pleroma@declin)1> Pleroma.Instances.Instance.get_or_update_metadata(URI.parse("https://lain.com"))
a test case for the update part is missing, and a call to get_or_update_metadata to actually populate it
** (RuntimeError) you are attempting to change relation :metadata of Pleroma.Instances.Instance but the `:on_replace` option of this relation is set to `:raise`.
By default it is not possible to replace or delete embeds and associations during `cast`. Therefore Ecto requires the parameters given to `cast` to have IDs matching the data currently associated to Pleroma.Instances.Instance. Failing to do so results in this error message.
If you want to replace data or automatically delete any data not sent to cast
, please set the appropriate :on_replace
option when defining the relation. The docs for Ecto.Changeset
covers the supported options in the "Associations, embeds and on replace" section.
However, if you don't want to allow data to be replaced or deleted, only updated, make sure that:
- If you are attempting to update an existing entry, you are including the entry primary key (ID) in the data.
- If you have a relationship with many children, all children must be given on update.
the only thing probably using this functionality in the wild is https://256.lt/mrf/software_policy.ex which tries to use both incompatible implementations
plz fix