From 2b9563be671af158adbd6cbe2b589b61e4b80c52 Mon Sep 17 00:00:00 2001 From: Jimmy Brush Date: Sun, 5 Oct 2025 18:28:05 -0400 Subject: [PATCH] Fix off-by-one in sync v5 Simplified sliding sync specifies ranges to be inclusive while rust ranges are exclusive. --- src/api/client/sync/v5.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/client/sync/v5.rs b/src/api/client/sync/v5.rs index 4751fd84..c61987f9 100644 --- a/src/api/client/sync/v5.rs +++ b/src/api/client/sync/v5.rs @@ -286,6 +286,7 @@ where let ranges = list.ranges.clone(); for mut range in ranges { range.0 = uint!(0); + range.1 = range.1.checked_add(uint!(1)).unwrap_or(range.1); range.1 = range .1 .clamp(range.0, UInt::try_from(active_rooms.len()).unwrap_or(UInt::MAX));