Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion src/handlers/encrypted_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -99,7 +100,9 @@ fn collection_limit(collection: &str) -> HandlerResult<usize> {
"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(),
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/handlers/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
Loading