From 64c530672e2d9a52af58e121c9e8d93f740e5ca1 Mon Sep 17 00:00:00 2001 From: D3SOX Date: Tue, 3 Nov 2026 07:47:01 +0100 Subject: [PATCH] feat(sync): accept encrypted seen RSS item marks Clients sync the RSS feed items marked as seen in a separate seenRssItems collection. The seen_rss_items capability tells them the server accepts it; older clients ignore both. --- README.md | 8 +++++--- src/dto.rs | 1 + src/handlers/encrypted_sync.rs | 7 ++++++- src/handlers/health.rs | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dcebefc..906bb79 100644 --- a/README.md +++ b/README.md @@ -260,13 +260,15 @@ 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, watch statistics, and versioned or legacy -sessions, 16 MiB for subscriptions, playlist bookmarks, seen-video or -seen-post marks, and external media positions, and 64 MiB for playlists and history. The `seen_posts: 1` +sessions, 16 MiB for subscriptions, playlist bookmarks, seen-video, seen-post +or seen RSS item marks, and external media positions, and 64 MiB for playlists and history. The `seen_posts: 1` capability enables the separate `seenPosts` collection, so older clients syncing `seenVideos` cannot erase post marks. The `watch_stats: 1` capability enables the `watchStats` collection for per-device totals. The `external_media_positions: 1` capability enables the `externalMediaPositions` -collection for playback positions of media that clients open by URL. +collection for playback positions of media that clients open by URL. The +`seen_rss_items: 1` capability enables the `seenRssItems` collection for the +RSS feed items that clients marked as seen. The combined active encrypted collections for one account cannot exceed 128 MiB. Capability `collection_changes: 1` lets clients upload a small encrypted change diff --git a/src/dto.rs b/src/dto.rs index 27184c9..991376b 100644 --- a/src/dto.rs +++ b/src/dto.rs @@ -36,6 +36,7 @@ pub struct SyncCapabilities { pub watch_stats: u8, pub live_reminders: u8, pub external_media_positions: u8, + pub seen_rss_items: u8, pub live_sync: u8, /// Collections accept appended changes and incremental reads. pub collection_changes: u8, diff --git a/src/handlers/encrypted_sync.rs b/src/handlers/encrypted_sync.rs index 561d089..549c45d 100644 --- a/src/handlers/encrypted_sync.rs +++ b/src/handlers/encrypted_sync.rs @@ -85,6 +85,7 @@ pub(crate) fn sync_capabilities() -> SyncCapabilities { watch_stats: 1, live_reminders: 1, external_media_positions: 1, + seen_rss_items: 1, live_sync: 1, collection_changes: 1, } @@ -99,7 +100,9 @@ fn collection_limit(collection: &str) -> HandlerResult { "watchStats" | "liveReminders" => Ok(8 * MEBIBYTE), // Playback positions of media opened by URL instead of from YouTube. "externalMediaPositions" => Ok(16 * MEBIBYTE), - "subscriptions" | "playlistBookmarks" | "seenVideos" | "seenPosts" => Ok(16 * MEBIBYTE), + "subscriptions" | "playlistBookmarks" | "seenVideos" | "seenPosts" | "seenRssItems" => { + Ok(16 * MEBIBYTE) + } "playlists" | "history" => Ok(MAX_ENCRYPTED_SYNC_BYTES), _ => Err(HandlerError::ValidationErrorWithContext( "unknown encrypted sync collection".to_owned(), @@ -573,6 +576,8 @@ mod tests { 16 * MEBIBYTE ); assert_eq!(super::sync_capabilities().external_media_positions, 1); + assert_eq!(collection_limit("seenRssItems").unwrap(), 16 * MEBIBYTE); + assert_eq!(super::sync_capabilities().seen_rss_items, 1); assert_eq!(super::sync_capabilities().live_reminders, 1); assert_eq!(super::sync_capabilities().watch_stats, 1); assert_eq!(super::sync_capabilities().seen_videos, 1); diff --git a/src/handlers/health.rs b/src/handlers/health.rs index b8cf087..cc0ecee 100644 --- a/src/handlers/health.rs +++ b/src/handlers/health.rs @@ -58,6 +58,7 @@ mod tests { assert_eq!(json["status"], "ok"); assert_eq!(json["capabilities"]["encrypted_sync"], 1); assert_eq!(json["capabilities"]["external_media_positions"], 1); + assert_eq!(json["capabilities"]["seen_rss_items"], 1); match &policy { Some(url) => assert_eq!(json["privacy_policy_url"], *url), None => assert!(json.get("privacy_policy_url").is_none()),