From a39fe47863cc27cc108310070fa7dfe2b245aa62 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 24 Sep 2026 13:58:03 +0800 Subject: [PATCH] proto: keep cursor ids as strings in JS A Windows peer before 1.5.0 names a cursor by its handle, sign-extended above 2^53 when its top bit is set. The web client decodes u64 fields into JS numbers, and ts-proto throws on a value a number cannot hold, so each such cursor_data or cursor_id was dropped whole and the web cursor stayed on the shape before. [jstype = JS_STRING] makes ts-proto generate these two fields as strings; the wire format, the Rust code generated and every other client are unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab --- libs/base/protos/message.proto | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/base/protos/message.proto b/libs/base/protos/message.proto index 668dfff06..991e8a31e 100644 --- a/libs/base/protos/message.proto +++ b/libs/base/protos/message.proto @@ -310,7 +310,9 @@ message KeyEvent { } message CursorData { - uint64 id = 1; + // A string in JS: a Windows peer before 1.5.0 sends its cursor handle, sign-extended above + // 2^53 when its top bit is set, which a JS number cannot hold. + uint64 id = 1 [jstype = JS_STRING]; sint32 hotx = 2; sint32 hoty = 3; int32 width = 4; @@ -1008,7 +1010,7 @@ message Message { AudioFrame audio_frame = 11; CursorData cursor_data = 12; CursorPosition cursor_position = 13; - uint64 cursor_id = 14; + uint64 cursor_id = 14 [jstype = JS_STRING]; // as CursorData.id KeyEvent key_event = 15; Clipboard clipboard = 16; FileAction file_action = 17;