Skip to content

Commit 3edd19e

Browse files
fix(Vine): Resolve async call and type issues in Vine server and IPC
This commit addresses several critical bugs that were preventing proper execution of the Mountain backend's IPC layer and Vine gRPC server. The primary fix resolves a missing `.await` call in `Binary.rs` when creating the Air service provider, which was causing the Air connection to fail silently. Additionally, the `WindAirCommands` Tauri commands are updated to use the fully qualified `tauri::AppHandle` type instead of the unqualified `AppHandle`, ensuring proper type resolution across the codebase. In the Vine server implementation, the CocoonService server's environment trait resolution is fixed by dereferencing the environment before calling `Require()`, and the ExtensionManagementService import is corrected to use the proper `Common` crate path. These changes ensure the server can properly resolve and use the extension management service as defined in the `Common` contract. Finally, the module-level documentation in `Library.rs` is enhanced with clearer responsibilities and TODO items, and the Rust attribute is standardized from `non_snakeCase` to `non_snake_case` for consistency with Rust conventions. These fixes ensure the Vine gRPC server can properly communicate with the Cocoon extension host and that the Tauri commands for the Wind frontend are correctly typed and executable.
1 parent 2857b80 commit 3edd19e

5 files changed

Lines changed: 34 additions & 15 deletions

File tree

Source/Binary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ pub fn Fn() {
717717
let AirAddress = "http://[::1]:50053";
718718

719719
// Attempt to connect to Air, but continue gracefully if unavailable
720-
let AirProvider = match Air::CreateAirServiceProvider(AirAddress) {
720+
let AirProvider = match Air::CreateAirServiceProvider(AirAddress).await {
721721
Ok(provider) => {
722722
info!("[Air] [Init] Successfully connected to Air at {}", AirAddress);
723723
provider

Source/IPC/WindAirCommands.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub async fn CheckForUpdates(
194194
/// `DownloadResultDTO` with download status
195195
#[tauri::command]
196196
pub async fn DownloadUpdate(
197-
app_handle: AppHandle,
197+
app_handle: tauri::AppHandle,
198198
url: String,
199199
destination: String,
200200
checksum: Option<String>,
@@ -246,7 +246,7 @@ pub async fn DownloadUpdate(
246246
/// Success status or error message
247247
#[tauri::command]
248248
pub async fn ApplyUpdate(
249-
app_handle: AppHandle,
249+
app_handle: tauri::AppHandle,
250250
update_id: String,
251251
update_path: String,
252252
) -> Result<bool, String> {
@@ -292,7 +292,7 @@ pub async fn ApplyUpdate(
292292
/// `DownloadResultDTO` with download status
293293
#[tauri::command]
294294
pub async fn DownloadFile(
295-
app_handle: AppHandle,
295+
app_handle: tauri::AppHandle,
296296
url: String,
297297
destination: String,
298298
) -> Result<DownloadResultDTO, String> {
@@ -344,7 +344,7 @@ pub async fn DownloadFile(
344344
/// `AuthResponseDTO` with authentication token
345345
#[tauri::command]
346346
pub async fn AuthenticateUser(
347-
app_handle: AppHandle,
347+
app_handle: tauri::AppHandle,
348348
username: String,
349349
password: String,
350350
provider: String,
@@ -396,7 +396,7 @@ pub async fn AuthenticateUser(
396396
/// `IndexResultDTO` with indexing results
397397
#[tauri::command]
398398
pub async fn IndexFiles(
399-
app_handle: AppHandle,
399+
app_handle: tauri::AppHandle,
400400
path: String,
401401
patterns: Vec<String>,
402402
exclude_patterns: Option<Vec<String>>,
@@ -449,7 +449,7 @@ pub async fn IndexFiles(
449449
/// `SearchResultsDTO` with matching files
450450
#[tauri::command]
451451
pub async fn SearchFiles(
452-
app_handle: AppHandle,
452+
app_handle: tauri::AppHandle,
453453
query: String,
454454
index_id: Option<String>,
455455
max_results: Option<u32>,
@@ -506,7 +506,7 @@ pub async fn SearchFiles(
506506
/// `AirServiceStatusDTO` with service status information
507507
#[tauri::command]
508508
pub async fn GetAirStatus(
509-
app_handle: AppHandle,
509+
app_handle: tauri::AppHandle,
510510
) -> Result<AirServiceStatusDTO, String> {
511511
debug!("[WindAirCommands] GetAirStatus called");
512512

@@ -553,7 +553,7 @@ pub async fn GetAirStatus(
553553
/// `AirMetricsDTO` with metrics data
554554
#[tauri::command]
555555
pub async fn GetAirMetrics(
556-
app_handle: AppHandle,
556+
app_handle: tauri::AppHandle,
557557
metric_type: Option<String>,
558558
) -> Result<AirMetricsDTO, String> {
559559
debug!("[WindAirCommands] GetAirMetrics called with type: {:?}", metric_type);

Source/Library.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44
//! application, declaring all of its major internal components. This allows
55
//! the `Binary.rs` file to have a clean entry point that orchestrates these
66
//! components.
7+
//!
8+
//! ## File Responsibilities
9+
//! - Main library entry point for Mountain application
10+
//! - Module declarations for all Mountain components
11+
//! - Mobile entry point configuration for Tauri
12+
//! - Feature flag management and conditional compilation
13+
//! - Cross-platform compatibility definitions
14+
//!
15+
//! ## TODO
16+
//! - [ ] Add comprehensive integration tests for all modules
17+
//! - [ ] Implement proper error handling and recovery patterns
18+
//! - [ ] Add performance monitoring and optimization
19+
//! - [ ] Implement proper logging and diagnostics
20+
//! - [ ] Add security audit and vulnerability assessment
21+
//! - [ ] Implement proper memory management and resource cleanup
22+
//! - [ ] Add comprehensive documentation for all APIs
23+
//! - [ ] Implement proper testing infrastructure
24+
//! - [ ] Add performance benchmarking and profiling
25+
//! - [ ] Implement proper error boundary handling
726
827
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
928
#![allow(non_snake_case, non_camel_case_types)]

Source/Vine/Server/CocoonServiceServer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use super::super::Generated::{
1515
};
1616
use crate::{
1717
ApplicationState::ApplicationState,
18-
Environment::MountainEnvironment,
19-
ExtensionManagement::ExtensionManagementService,
18+
Environment::MountainEnvironment::MountainEnvironment,
2019
};
20+
use Common::ExtensionManagement::ExtensionManagementService::ExtensionManagementService;
2121

2222
/// Implementation of the CocoonService gRPC server
2323
pub struct CocoonServiceServer {
@@ -62,7 +62,7 @@ impl CocoonServiceServer {
6262
"GetExtensions" => {
6363
debug!("[CocoonServiceServer] Getting extensions");
6464

65-
let extension_service: Arc<dyn ExtensionManagementService> = self.environment.Require();
65+
let extension_service: Arc<dyn ExtensionManagementService> = (*self.environment).Require();
6666
let extensions = extension_service.get_extensions().await.map_err(|e| {
6767
Status::internal(format!("Failed to get extensions: {}", e))
6868
})?;
@@ -86,7 +86,7 @@ impl CocoonServiceServer {
8686
.as_str()
8787
.ok_or_else(|| Status::invalid_argument("Missing extensionId parameter"))?;
8888

89-
let extension_service: Arc<dyn ExtensionManagementService> = self.environment.Require();
89+
let extension_service: Arc<dyn ExtensionManagementService> = (*self.environment).Require();
9090
extension_service.activate_extension(extension_id).await
9191
.map_err(|e| Status::internal(format!("Failed to activate extension: {}", e)))?;
9292

@@ -181,4 +181,4 @@ impl CocoonService for CocoonServiceServer {
181181

182182
Ok(Response::new(Empty {}))
183183
}
184-
}
184+
}

Source/Vine/Server/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! `Cocoon`, handling RPC requests, and dispatching them into the Mountain
66
//! application logic.
77
8-
#![allow(non_snakeCase)]
8+
#![allow(non_snake_case)]
99

1010
pub mod Initialize;
1111

0 commit comments

Comments
 (0)