From 02ec0982833fd408a81f58527f7414093206cf1d Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Mon, 25 Aug 2025 16:27:25 +0100 Subject: [PATCH] Fix reversed selections --- frontend/sync-client/src/sync-operations/cursor-tracker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/sync-client/src/sync-operations/cursor-tracker.ts b/frontend/sync-client/src/sync-operations/cursor-tracker.ts index 28ca8b33..a2233e6a 100644 --- a/frontend/sync-client/src/sync-operations/cursor-tracker.ts +++ b/frontend/sync-client/src/sync-operations/cursor-tracker.ts @@ -104,7 +104,10 @@ export class CursorTracker { relative_path: relativePath, document_id: record.documentId, vault_update_id: record.metadata.parentVersionId, - cursors + cursors: cursors.map(({ start, end }) => ({ + start: Math.min(start, end), + end: Math.max(start, end) + })) // the client might send directional selections }); }