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,11 +260,13 @@ 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, and seen-video or
seen-post marks, and 64 MiB for playlists and history. The `seen_posts: 1`
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`
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.
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.
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 @@ -35,6 +35,7 @@ pub struct SyncCapabilities {
pub seen_posts: u8,
pub watch_stats: u8,
pub live_reminders: u8,
pub external_media_positions: u8,
pub live_sync: u8,
/// Collections accept appended changes and incremental reads.
pub collection_changes: u8,
Expand Down
8 changes: 8 additions & 0 deletions src/handlers/encrypted_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ pub(crate) fn sync_capabilities() -> SyncCapabilities {
seen_posts: 1,
watch_stats: 1,
live_reminders: 1,
external_media_positions: 1,
live_sync: 1,
collection_changes: 1,
}
Expand All @@ -96,6 +97,8 @@ fn collection_limit(collection: &str) -> HandlerResult<usize> {
"sessions" | "sessionsV2" | "profiles" | "playbackSpeeds" => Ok(8 * MEBIBYTE),
// Per-device watch time totals are merged by clients.
"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),
"playlists" | "history" => Ok(MAX_ENCRYPTED_SYNC_BYTES),
_ => Err(HandlerError::ValidationErrorWithContext(
Expand Down Expand Up @@ -565,6 +568,11 @@ mod tests {
assert_eq!(collection_limit("seenVideos").unwrap(), 16 * MEBIBYTE);
assert_eq!(collection_limit("watchStats").unwrap(), 8 * MEBIBYTE);
assert_eq!(collection_limit("liveReminders").unwrap(), 8 * MEBIBYTE);
assert_eq!(
collection_limit("externalMediaPositions").unwrap(),
16 * MEBIBYTE
);
assert_eq!(super::sync_capabilities().external_media_positions, 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 @@ -57,6 +57,7 @@ mod tests {
actix_web::test::call_and_read_body_json(&app, request).await;
assert_eq!(json["status"], "ok");
assert_eq!(json["capabilities"]["encrypted_sync"], 1);
assert_eq!(json["capabilities"]["external_media_positions"], 1);
match &policy {
Some(url) => assert_eq!(json["privacy_policy_url"], *url),
None => assert!(json.get("privacy_policy_url").is_none()),
Expand Down
Loading