pass commit_uri to orm_update

feat/orm
Niko PLP 6 days ago
parent a48e0b00c8
commit e6d3cbc337
  1. 4
      ng-verifier/src/commits/transaction.rs
  2. 29
      ng-verifier/src/orm/mod.rs

@ -740,7 +740,8 @@ impl Verifier {
.await; .await;
} else { } else {
let graph_patch = update.transaction.as_patch(); let graph_patch = update.transaction.as_patch();
commit_nuris.push(NuriV0::commit(&update.repo_id, &update.commit_id)); let nuri = NuriV0::commit(&update.repo_id, &update.commit_id);
commit_nuris.push(nuri.clone());
self.push_app_response( self.push_app_response(
&update.branch_id, &update.branch_id,
AppResponse::V0(AppResponseV0::Patch(AppPatch { AppResponse::V0(AppResponseV0::Patch(AppPatch {
@ -756,6 +757,7 @@ impl Verifier {
NuriV0::repo_graph_name(&update.repo_id, &update.overlay_id); NuriV0::repo_graph_name(&update.repo_id, &update.overlay_id);
self.orm_update( self.orm_update(
&NuriV0::new_empty(), &NuriV0::new_empty(),
nuri,
update.transaction.as_quads_patch(graph_nuri), update.transaction.as_quads_patch(graph_nuri),
) )
.await; .await;

@ -622,7 +622,28 @@ impl Verifier {
return Ok(return_vals); return Ok(return_vals);
} }
pub(crate) async fn orm_update(&mut self, scope: &NuriV0, patch: GraphQuadsPatch) {} pub(crate) async fn orm_update(
&mut self,
scope: &NuriV0,
commit_nuri: String,
patch: GraphQuadsPatch,
) {
if let Some(subs) = self.orm_subscriptions.get(scope) {
for sub in subs {
// //TODO fix this
// let orm_diff = ??;
// self.push_orm_response(
// scope,
// sub.session_id,
// sub.sender.clone(),
// AppResponse::V0(AppResponseV0::OrmUpdate(orm_diff)),
// )
// .await;
}
}
}
pub(crate) async fn orm_frontend_update( pub(crate) async fn orm_frontend_update(
&mut self, &mut self,
@ -686,14 +707,14 @@ impl Verifier {
.or_insert(vec![]) .or_insert(vec![])
.push(orm_subscription); .push(orm_subscription);
let _orm_objects = self.create_orm_object_for_shape(nuri, session_id, &shape_type)?; let orm_objects = self.create_orm_object_for_shape(nuri, session_id, &shape_type)?;
// log_debug!("create_orm_object_for_shape return {:?}", _orm_objects); // log_debug!("create_orm_object_for_shape return {:?}", orm_objects);
self.push_orm_response( self.push_orm_response(
&nuri.clone(), &nuri.clone(),
session_id, session_id,
tx.clone(), tx.clone(),
AppResponse::V0(AppResponseV0::OrmInitial(_orm_objects)), AppResponse::V0(AppResponseV0::OrmInitial(orm_objects)),
) )
.await; .await;

Loading…
Cancel
Save