Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ futures-util = "0.3"
hkdf = "0.12"
hmac = "0.12"
mdbase = { path = "../mdbase-rs" }
mdbase-interop = { version = "0.1.0-rc.2", git = "https://github.com/mdbase-dev/mdbase-spec.git", rev = "362953e2644b07a7b61f92068a27ac6f917ee5c1" }
mdbase-interop = { version = "0.1.0-rc.2", git = "https://github.com/mdbase-dev/mdbase-spec.git", rev = "5aa34fd14de2e0ae9e565425b724b306046b64ca" }
mdbase-runtime = { path = "../mdbase-rs/crates/mdbase-runtime" }
notify = "8"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls-webpki-roots-no-provider"] }
Expand Down
3 changes: 1 addition & 2 deletions config/architecture-budgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"services/server": 128
},
"deadCodeReferencesByFile": {
"crates/connect-core/src/registry/runtime_operations.rs": 1,
"crates/connect-hosted-provider/src/workspace.rs": 1,
"crates/connect-hosted-storage-benchmark/src/main/legacy_query.rs": 1,
"crates/connect-hosted-storage-benchmark/src/main/query.rs": 1
Expand All @@ -40,7 +39,7 @@
"productionFiles": 665,
"relativeImports": 1382,
"workspacePackages": 24,
"rustPublicDeclarations": 3101,
"rustPublicDeclarations": 3111,
"typeScriptExportDeclarations": 2311,
"mdbaseCollectionReferences": 16,
"typedCollectionReferences": 1
Expand Down
13 changes: 8 additions & 5 deletions crates/connect-core/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,16 @@ use operation_execution::{
pub use receipts::AuthorityReceiptDiagnostics;
use runtime_executor::CollectionExecutor;
use runtime_operations::{
execute_runtime_read, execute_runtime_request, operation_context, require_runtime,
scope_binding,
execute_runtime_read, execute_runtime_request, operation_context, operation_response_value,
require_runtime, scope_binding, v03_operation_result,
};
#[cfg(test)]
use runtime_operations::{set_scoped_preflight_hook, ScopedPreflightEvent};
use scope::{
change_is_in_scope, contract_scope_error, ensure_no_new_out_of_scope_types,
ensure_result_in_scope, ensure_types_in_scope, required_string, required_uuid, result_types,
sync_resources,
authorize_scoped_mutation_preflight, change_is_in_scope, contract_scope_error,
ensure_no_new_out_of_scope_types, ensure_operation_in_scope, ensure_result_in_scope,
ensure_types_in_scope, operation_record, required_string, required_uuid, result_types,
sync_resources, validate_scoped_mutation_request,
};

#[derive(Debug, Error)]
Expand Down
2 changes: 1 addition & 1 deletion crates/connect-core/src/registry/operation_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pub(super) fn typed_error_result(error: mdbase::api::MdbaseError) -> Value {
.collect(),
),
MdbaseError::InvalidRequest { message } => ("invalid_request", message, Vec::new()),
MdbaseError::Operation { diagnostics } => (
MdbaseError::Operation { diagnostics } | MdbaseError::PartialBatch { diagnostics, .. } => (
"operation_failed",
"The mdbase operation failed.".to_string(),
diagnostics
Expand Down
12 changes: 6 additions & 6 deletions crates/connect-core/src/registry/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl CollectionRegistry {
execute_runtime_request(require_runtime(runtime)?, &request, None, &context)
})?;
synchronize()?;
Ok(serde_json::to_value(result.result)?)
operation_response_value(&result.operation)
} else {
let execution = execute_runtime_read(
&executor,
Expand All @@ -75,7 +75,7 @@ impl CollectionRegistry {
&scope_binding(&GrantScope::full_collection())?,
&context,
)?;
serde_json::to_value(execution.result).map_err(ConnectError::from)
operation_response_value(&execution.operation)
}
} else {
let provider = executor.provider();
Expand Down Expand Up @@ -319,10 +319,10 @@ impl CollectionRegistry {
);
let context = operation_context(&mdbase::OperationCancellation::new());
let applied = executor.with_mutation(&context, |runtime| {
let result =
execute_runtime_request(require_runtime(runtime)?, &request, None, &context)?
.result;
if !result.valid {
let execution =
execute_runtime_request(require_runtime(runtime)?, &request, None, &context)?;
let result = v03_operation_result(&execution.operation);
if !execution.operation.valid {
return Err(type_pack_setup_error(&result));
}
Ok(result.result)
Expand Down
6 changes: 3 additions & 3 deletions crates/connect-core/src/registry/runtime_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const WAIT_SLICE: Duration = Duration::from_millis(10);
const MAX_EXTERNAL_READ_CURSORS: usize = 4_096;

pub(super) struct CoordinatedReadPage {
pub result: mdbase::v03::OperationResult,
pub operation: mdbase::runtime::CanonicalOperationOutcome,
pub next: Option<String>,
}

Expand Down Expand Up @@ -183,7 +183,7 @@ impl CollectionExecutor {
None => None,
};
Ok(CoordinatedReadPage {
result: page.outcome.result,
operation: page.outcome.operation,
next,
})
}
Expand Down Expand Up @@ -261,7 +261,7 @@ impl CollectionExecutor {
}
};
Ok(CoordinatedReadPage {
result: page.outcome.result,
operation: page.outcome.operation,
next,
})
}
Expand Down
Loading
Loading