Skip to main content

gobby_code/projection/
mod.rs

1use crate::config::Context;
2use crate::graph::code_graph;
3use crate::vector::code_symbols;
4
5pub mod sync;
6
7#[derive(Debug, Clone, PartialEq, Eq)]
8pub struct ProjectionReconcileFailure {
9    pub target: sync::ProjectionTarget,
10    pub message: String,
11}
12
13pub fn reconcile_deleted_file(ctx: &Context, file_path: &str) -> Vec<ProjectionReconcileFailure> {
14    let mut failures = Vec::new();
15
16    if ctx.falkordb.is_some()
17        && let Err(error) = code_graph::delete_file_projection(ctx, file_path)
18    {
19        failures.push(ProjectionReconcileFailure {
20            target: sync::ProjectionTarget::Graph,
21            message: error.to_string(),
22        });
23    }
24
25    if let Some(qdrant) = ctx.qdrant.as_ref()
26        && let Err(error) = code_symbols::delete_file_vectors(qdrant, &ctx.project_id, file_path)
27    {
28        failures.push(ProjectionReconcileFailure {
29            target: sync::ProjectionTarget::Vectors,
30            message: error.to_string(),
31        });
32    }
33
34    failures
35}