Skip to content

Commit

Permalink
Merge pull request #4185 from systeminit/add-ulid-error-on-pkg-file
Browse files Browse the repository at this point in the history
fix(dal): ensure we don't search for funcs by name
  • Loading branch information
stack72 committed Jul 20, 2024
2 parents 7eef287 + 864e12c commit 6938540
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/dal/src/pkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ pub enum PkgError {
TakingOutputSocketAsInputForPropUnsupported(String, String),
#[error("transactions error: {0}")]
Transactions(#[from] TransactionsError),
#[error(transparent)]
UlidDecode(#[from] ulid::DecodeError),
#[error("url parse error: {0}")]
Url(#[from] ParseError),
#[error("workspace error: {0}")]
Expand Down
7 changes: 5 additions & 2 deletions lib/dal/src/pkg/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use si_pkg::{
};
use std::collections::HashSet;
use std::fmt::Debug;
use std::str::FromStr;
use std::{collections::HashMap, path::Path};
use telemetry::prelude::*;
use tokio::sync::Mutex;
Expand Down Expand Up @@ -952,8 +953,10 @@ pub async fn import_only_new_funcs(
Func::get_by_id_or_error(ctx, func_id).await?
} else {
// Find or create the func for the provided spec.
let func = if let Some(func_id) = Func::find_id_by_name(ctx, &func_spec.name()).await? {
Func::get_by_id_or_error(ctx, func_id).await?
let func = if let Some(func) =
Func::get_by_id(ctx, FuncId::from_str(func_spec.unique_id())?).await?
{
func
} else {
create_func(ctx, &func_spec, false).await?
};
Expand Down

0 comments on commit 6938540

Please sign in to comment.