From dbb767d8e4b8b2928bb9c33d151c5878eca91c88 Mon Sep 17 00:00:00 2001 From: D3SOX Date: Wed, 2 Sep 2026 16:39:17 +0200 Subject: [PATCH] feat(sync): accept versioned tab sessions Supports OpenTubeX/OpenTubeX#1025 --- README.md | 6 +++--- src/handlers/encrypted_sync.rs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 78e820f..a2b079f 100644 --- a/README.md +++ b/README.md @@ -236,9 +236,9 @@ content. Before the first encrypted collection is uploaded, the manifest's Each legacy domain is removed transactionally only after its matching encrypted collection is stored, so an interrupted migration can safely resume. Ciphertext uploads have collection-specific limits: 2 MiB for settings, 8 MiB -for profiles, playback speeds, and sessions, 16 MiB for subscriptions and playlist -bookmarks, and 64 MiB for playlists and history. The combined active encrypted -collections for one account cannot exceed 128 MiB. +for profiles, playback speeds, and versioned or legacy sessions, 16 MiB for +subscriptions and playlist bookmarks, and 64 MiB for playlists and history. +The combined active encrypted collections for one account cannot exceed 128 MiB. ### Secure device pairing diff --git a/src/handlers/encrypted_sync.rs b/src/handlers/encrypted_sync.rs index 0e2587e..bb98e6b 100644 --- a/src/handlers/encrypted_sync.rs +++ b/src/handlers/encrypted_sync.rs @@ -66,7 +66,7 @@ fn collection_limit(collection: &str) -> HandlerResult { "settings" => Ok(2 * MEBIBYTE), // Deprecated compatibility collection. Saved channel preferences now // belong in `settings`; keep accepting this while old clients remain. - "sessions" | "profiles" | "playbackSpeeds" => Ok(8 * MEBIBYTE), + "sessions" | "sessionsV2" | "profiles" | "playbackSpeeds" => Ok(8 * MEBIBYTE), "subscriptions" | "playlistBookmarks" => Ok(16 * MEBIBYTE), "playlists" | "history" => Ok(MAX_ENCRYPTED_SYNC_BYTES), _ => Err(HandlerError::ValidationErrorWithContext( @@ -216,6 +216,7 @@ mod tests { assert_eq!(collection_limit("settings").unwrap(), 2 * MEBIBYTE); assert_eq!(collection_limit("profiles").unwrap(), 8 * MEBIBYTE); assert_eq!(collection_limit("sessions").unwrap(), 8 * MEBIBYTE); + assert_eq!(collection_limit("sessionsV2").unwrap(), 8 * MEBIBYTE); assert_eq!(collection_limit("subscriptions").unwrap(), 16 * MEBIBYTE); assert_eq!(collection_limit("history").unwrap(), 64 * MEBIBYTE); assert!(collection_limit("unknown").is_err());