From e6d3cbc33729bb79192a38ed2c8eb2d91ccf3e3d Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Mon, 13 Oct 2025 11:56:35 +0300 Subject: [PATCH] pass commit_uri to orm_update --- ng-verifier/src/commits/transaction.rs | 4 +++- ng-verifier/src/orm/mod.rs | 29 ++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ng-verifier/src/commits/transaction.rs b/ng-verifier/src/commits/transaction.rs index bab25f3..4e88b6c 100644 --- a/ng-verifier/src/commits/transaction.rs +++ b/ng-verifier/src/commits/transaction.rs @@ -740,7 +740,8 @@ impl Verifier { .await; } else { 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( &update.branch_id, AppResponse::V0(AppResponseV0::Patch(AppPatch { @@ -756,6 +757,7 @@ impl Verifier { NuriV0::repo_graph_name(&update.repo_id, &update.overlay_id); self.orm_update( &NuriV0::new_empty(), + nuri, update.transaction.as_quads_patch(graph_nuri), ) .await; diff --git a/ng-verifier/src/orm/mod.rs b/ng-verifier/src/orm/mod.rs index 336b998..cce5add 100644 --- a/ng-verifier/src/orm/mod.rs +++ b/ng-verifier/src/orm/mod.rs @@ -622,7 +622,28 @@ impl Verifier { 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( &mut self, @@ -686,14 +707,14 @@ impl Verifier { .or_insert(vec![]) .push(orm_subscription); - let _orm_objects = self.create_orm_object_for_shape(nuri, session_id, &shape_type)?; - // log_debug!("create_orm_object_for_shape return {:?}", _orm_objects); + let orm_objects = self.create_orm_object_for_shape(nuri, session_id, &shape_type)?; + // log_debug!("create_orm_object_for_shape return {:?}", orm_objects); self.push_orm_response( &nuri.clone(), session_id, tx.clone(), - AppResponse::V0(AppResponseV0::OrmInitial(_orm_objects)), + AppResponse::V0(AppResponseV0::OrmInitial(orm_objects)), ) .await;