Skip to content

Commit d8907c1

Browse files
committed
fix(desktop): harden Project connection lifecycle
Signed-off-by: KC <[email protected]>
1 parent 531a5bd commit d8907c1

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎desktop/src-tauri/src/managed_agents/project_connections.rs‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ fn validate_project_scope_for_app(
274274
scope: &ProjectConnectionScope,
275275
) -> Result<ProjectConnectionScope, String> {
276276
let canonical = canonical_project_scope(scope)?;
277-
if canonical != *scope {
278-
return Err("Buzz could not verify this Project's canonical identity.".to_string());
279-
}
280277
let state = app.state::<crate::app_state::AppState>();
281278
let active_relay = buzz_core_pkg::relay::normalize_relay_url(
282279
&crate::relay::relay_ws_url_with_override(&state),
@@ -905,9 +902,6 @@ pub fn delete_project_connection(
905902
connection.id == connection_id && connection.project_scope == project_scope
906903
})
907904
.ok_or_else(|| "This connection no longer exists in this Project.".to_string())?;
908-
if !store.connections[index].env_keys.is_empty() {
909-
load_secrets(app, &store.connections[index])?;
910-
}
911905
commit_delete(
912906
&mut store,
913907
index,

‎desktop/src-tauri/src/managed_agents/project_connections/tests.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ fn stored_connection() -> StoredProjectConnection {
3535
#[test]
3636
fn project_scope_requires_canonical_relay_identity_and_coordinate() {
3737
assert_eq!(canonical_project_scope(&scope()).unwrap(), scope());
38+
let mut localhost = scope();
39+
localhost.relay_url = "ws://localhost:3000".to_string();
40+
assert_eq!(canonical_project_scope(&localhost).unwrap(), scope());
3841
let mut invalid = scope();
3942
invalid.repo_address = "local-project-id".to_string();
4043
assert!(canonical_project_scope(&invalid).is_err());

0 commit comments

Comments
 (0)