Skip to content

Commit

Permalink
Merge pull request #4891 from systeminit/brit/bug-657-ensure-funcs-fo…
Browse files Browse the repository at this point in the history
…r-all-components-are-returned-when-listing

Don't filter out bindings for schema variants that have components on the canvas
  • Loading branch information
britmyerss authored Oct 30, 2024
2 parents 28b3509 + 1199d8e commit 88d9806
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/sdf-server/src/service/v2/func/list_funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,20 @@ async fn treat_single_function(
// If func is unlocked or intrinsic, we always use it,
// otherwise we return funcs that are bound to default variants
// OR not bound to anything, OR editing variants
// OR bound to variants with components on the canvas
if func.is_locked && !func.is_intrinsic() && !bindings.is_empty() {
let mut should_hide = true;
for binding in &bindings {
let Some(schema_variant_id) = binding.get_schema_variant() else {
continue;
};

let maybe_existing_components =
SchemaVariant::list_component_ids(ctx, schema_variant_id).await?;
if !maybe_existing_components.is_empty() {
should_hide = false;
}

let schema =
SchemaVariant::schema_id_for_schema_variant_id(ctx, schema_variant_id).await?;

Expand Down

0 comments on commit 88d9806

Please sign in to comment.