From 278fa912df4f5d37992a4bd5916ef01c435c2ff6 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 17 Aug 2025 10:57:50 +0100 Subject: [PATCH] Rename field --- frontend/sync-client/src/services/types/ClientCursors.ts | 2 +- .../sync-client/src/types/maybe-outdated-client-cursors.ts | 5 +++++ sync-server/src/app_state/cursors.rs | 2 +- sync-server/src/app_state/websocket/models.rs | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 frontend/sync-client/src/types/maybe-outdated-client-cursors.ts diff --git a/frontend/sync-client/src/services/types/ClientCursors.ts b/frontend/sync-client/src/services/types/ClientCursors.ts index 65da35e3..8222bfb0 100644 --- a/frontend/sync-client/src/services/types/ClientCursors.ts +++ b/frontend/sync-client/src/services/types/ClientCursors.ts @@ -4,5 +4,5 @@ import type { DocumentWithCursors } from "./DocumentWithCursors"; export interface ClientCursors { userName: string; deviceId: string; - cursors: DocumentWithCursors[]; + documentsWithCursors: DocumentWithCursors[]; } diff --git a/frontend/sync-client/src/types/maybe-outdated-client-cursors.ts b/frontend/sync-client/src/types/maybe-outdated-client-cursors.ts new file mode 100644 index 00000000..acced952 --- /dev/null +++ b/frontend/sync-client/src/types/maybe-outdated-client-cursors.ts @@ -0,0 +1,5 @@ +import type { ClientCursors } from "../services/types/ClientCursors"; + +export interface DocumentWithMaybeOutdatedClientCursors extends ClientCursors { + isOutdated: boolean; +} diff --git a/sync-server/src/app_state/cursors.rs b/sync-server/src/app_state/cursors.rs index 14bfb020..1e6509c7 100644 --- a/sync-server/src/app_state/cursors.rs +++ b/sync-server/src/app_state/cursors.rs @@ -48,7 +48,7 @@ impl Cursors { all_device_cursors.push(ClientCursorsWithTimeToLive::new(ClientCursors { user_name, device_id: device_id.to_string(), - cursors: document_to_cursors, + documents_with_cursors: document_to_cursors, })); drop(vault_to_cursors); // Explicitly drop the lock before broadcasting to avoid deadlock diff --git a/sync-server/src/app_state/websocket/models.rs b/sync-server/src/app_state/websocket/models.rs index fca0dfb7..ed61177c 100644 --- a/sync-server/src/app_state/websocket/models.rs +++ b/sync-server/src/app_state/websocket/models.rs @@ -43,7 +43,7 @@ pub struct CursorSpan { pub struct ClientCursors { pub user_name: String, pub device_id: DeviceId, - pub cursors: Vec, + pub documents_with_cursors: Vec, } #[derive(TS, Serialize, Clone, Debug)]