Skip to content

Commit 001a73f

Browse files
committed
wip
1 parent 4ae203b commit 001a73f

9 files changed

Lines changed: 128 additions & 65 deletions

File tree

app/src/remote_server/server_model.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,24 @@ impl ServerModel {
495495
conn_id: Option<ConnectionId>,
496496
request_id: Option<&RequestId>,
497497
) {
498+
let snapshot = self.codebase_index_statuses_snapshot();
499+
let status_count = snapshot.statuses.len();
500+
let target = conn_id
501+
.map(|conn_id| conn_id.to_string())
502+
.unwrap_or_else(|| "broadcast".to_string());
503+
let message_kind = if request_id.is_some() {
504+
"response"
505+
} else {
506+
"push"
507+
};
508+
log::info!(
509+
"Sending codebase index statuses snapshot: target={target} \
510+
message_kind={message_kind} status_count={status_count}"
511+
);
498512
self.send_server_message(
499513
conn_id,
500514
request_id,
501-
server_message::Message::CodebaseIndexStatusesSnapshot(
502-
self.codebase_index_statuses_snapshot(),
503-
),
515+
server_message::Message::CodebaseIndexStatusesSnapshot(snapshot),
504516
);
505517
}
506518

@@ -931,6 +943,12 @@ impl ServerModel {
931943
if let Some(status) =
932944
me.ensure_not_enabled_codebase_index_status(indexed_path.clone())
933945
{
946+
log::info!(
947+
"[Remote codebase indexing] Sending codebase index status update for navigated repo: \
948+
conn_id={conn_id_for_response} repo_path={} state={:?}",
949+
status.repo_path,
950+
status.state,
951+
);
934952
me.send_server_message(
935953
Some(conn_id_for_response),
936954
None,

app/src/terminal/model/session.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ impl Sessions {
170170
| RemoteServerManagerEvent::SessionConnectionFailed { .. }
171171
| RemoteServerManagerEvent::HostConnected { .. }
172172
| RemoteServerManagerEvent::HostDisconnected { .. }
173-
| RemoteServerManagerEvent::RemoteCodebaseIndexingCapability { .. }
174173
| RemoteServerManagerEvent::NavigatedToDirectory { .. }
175174
| RemoteServerManagerEvent::RepoMetadataSnapshot { .. }
176175
| RemoteServerManagerEvent::RepoMetadataUpdated { .. }

app/src/terminal/view.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4497,7 +4497,6 @@ impl TerminalView {
44974497
| RemoteServerManagerEvent::SessionReconnected { .. }
44984498
| RemoteServerManagerEvent::HostConnected { .. }
44994499
| RemoteServerManagerEvent::HostDisconnected { .. }
4500-
| RemoteServerManagerEvent::RemoteCodebaseIndexingCapability { .. }
45014500
| RemoteServerManagerEvent::RepoMetadataSnapshot { .. }
45024501
| RemoteServerManagerEvent::RepoMetadataUpdated { .. }
45034502
| RemoteServerManagerEvent::RepoMetadataDirectoryLoaded { .. }

app/src/terminal/writeable_pty/remote_server_controller.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ impl<T: EventLoopSender> RemoteServerController<T> {
135135
| RemoteServerManagerEvent::SessionDeregistered { .. }
136136
| RemoteServerManagerEvent::HostConnected { .. }
137137
| RemoteServerManagerEvent::HostDisconnected { .. }
138-
| RemoteServerManagerEvent::RemoteCodebaseIndexingCapability { .. }
139138
| RemoteServerManagerEvent::NavigatedToDirectory { .. }
140139
| RemoteServerManagerEvent::RepoMetadataSnapshot { .. }
141140
| RemoteServerManagerEvent::RepoMetadataUpdated { .. }

crates/remote_server/proto/remote_server.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ message ServerMessage {
4949
}
5050

5151
// ── Initialize handshake
52-
53-
5452
// Sent by the client immediately after connecting to negotiate the protocol.
5553
message Initialize {
5654
// Optional bearer token used by the daemon for Warp-server requests.

crates/remote_server/src/client/mod.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ use std::sync::atomic::{AtomicBool, Ordering};
44
use std::sync::Arc;
55
use std::time::Duration;
66

7-
use crate::codebase_index_proto::RemoteCodebaseIndexStatus;
7+
use crate::codebase_index_proto::{
8+
proto_to_codebase_index_status_updated, proto_to_codebase_index_statuses_snapshot,
9+
RemoteCodebaseIndexStatus,
10+
};
811
use dashmap::DashMap;
912
use futures::channel::oneshot;
1013
use futures::io::{AsyncRead, AsyncWrite};
@@ -242,9 +245,9 @@ impl RemoteServerClient {
242245
let response = self.send_request(request_id, msg).await?;
243246

244247
match response.message {
245-
Some(server_message::Message::CodebaseIndexStatusesSnapshot(snapshot)) => Ok(
246-
crate::codebase_index_proto::proto_to_codebase_index_statuses_snapshot(&snapshot),
247-
),
248+
Some(server_message::Message::CodebaseIndexStatusesSnapshot(snapshot)) => {
249+
Ok(proto_to_codebase_index_statuses_snapshot(&snapshot))
250+
}
248251
other => {
249252
safe_error!(
250253
safe: ("Remote server unexpected response for ListCodebaseIndexStatuses"),
@@ -455,15 +458,11 @@ impl RemoteServerClient {
455458
}
456459
server_message::Message::CodebaseIndexStatusesSnapshot(snapshot) => {
457460
Some(ClientEvent::CodebaseIndexStatusesSnapshotReceived {
458-
statuses:
459-
crate::codebase_index_proto::proto_to_codebase_index_statuses_snapshot(
460-
&snapshot,
461-
),
461+
statuses: proto_to_codebase_index_statuses_snapshot(&snapshot),
462462
})
463463
}
464464
server_message::Message::CodebaseIndexStatusUpdated(update) => {
465-
let status =
466-
crate::codebase_index_proto::proto_to_codebase_index_status_updated(&update)?;
465+
let status = proto_to_codebase_index_status_updated(&update)?;
467466
Some(ClientEvent::CodebaseIndexStatusUpdated { status })
468467
}
469468
other => {

crates/remote_server/src/client_tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ async fn initialize_round_trip() {
157157
server_message::Message::InitializeResponse(InitializeResponse {
158158
server_version: "test-0.1.0".to_string(),
159159
host_id: "test-host-id".to_string(),
160-
capabilities: vec![],
161160
})
162161
});
163162

@@ -188,7 +187,6 @@ async fn initialize_sends_empty_auth_token_when_none() {
188187
server_message::Message::InitializeResponse(InitializeResponse {
189188
server_version: "test-0.1.0".to_string(),
190189
host_id: "test-host-id".to_string(),
191-
capabilities: vec![],
192190
})
193191
});
194192

@@ -217,7 +215,6 @@ async fn initialize_sends_auth_token_when_provided() {
217215
server_message::Message::InitializeResponse(InitializeResponse {
218216
server_version: "test-0.1.0".to_string(),
219217
host_id: "test-host-id".to_string(),
220-
capabilities: vec![],
221218
})
222219
});
223220

@@ -325,7 +322,6 @@ async fn concurrent_in_flight_requests() {
325322
server_message::Message::InitializeResponse(InitializeResponse {
326323
server_version: "test-0.1.0".to_string(),
327324
host_id: "test-host-id".to_string(),
328-
capabilities: vec![],
329325
})
330326
});
331327
let client = std::sync::Arc::new(client);
@@ -370,7 +366,6 @@ async fn mock_server_with_error_handling(
370366
InitializeResponse {
371367
server_version: "test-0.1.0".to_string(),
372368
host_id: "test-host-id".to_string(),
373-
capabilities: vec![],
374369
},
375370
)),
376371
};

0 commit comments

Comments
 (0)