fix: don't create a new context if missing, use id

This commit is contained in:
əlemi 2024-05-20 21:21:13 +02:00
parent 702248348c
commit 32dd5163bb
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -38,7 +38,7 @@ impl Normalizer for super::Context {
(Some(reply_id), None) => // get context from replied object
object_model.context = self.fetch_object(reply_id).await?.context,
(None, None) => // generate a new context
object_model.context = Some(crate::url!(self, "/context/{}", uuid::Uuid::new_v4().to_string())),
object_model.context = Some(object_model.id.clone()),
(_, Some(_)) => {}, // leave it as set by user
}