Repository navigation
feat(sync): give separate profiles their own encrypted collections - #48
Conversation
Accept history, playlists, subscriptions and watchStats collections scoped to a profile as <name>.<hex profile ID>, a separateProfiles collection for their names and colors, and DELETE for a scoped collection once its profile is deleted. Advertise this as separate_profiles.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
OpenTubeX is getting separate profiles (OpenTubeX#3291). A separate profile keeps its own subscriptions, history, playlists and watch statistics, and each device syncs them while that profile is active. Clients need a place on the server for that data that older clients never read, so they can't mix it into their own.
The server now accepts
history.<scope>,playlists.<scope>,subscriptions.<scope>andwatchStats.<scope>, where<scope>is the profile ID in lowercase hex (up to 128 digits). Each has the size limit of its base collection. A newseparateProfilescollection (8 MiB) holds the profiles' names and colors.DELETE /v1/encrypted_sync/{collection}(and its alias) deletes one of these scoped collections with its pending changes after the profile is deleted. It returns204even when the collection is already gone, and400for any shared collection./healthadvertisesseparate_profiles: 1. The README documents the collections, the endpoint and the capability; prettier rewrapped the two tables it touched.Proof: new tests check the scoped limits, which names are refused (uppercase, odd length, nested dots, slashes, other bases, too long), the capability, and the DELETE behavior against SQLite.
cargo fmt --check,cargo clippyandcargo test(107 tests) pass. I also ran this branch locally and pointed the OpenTubeX network sync E2E tests from the app PR at it: 12 passed, including the new separate profile case, and 1 skipped because the server doesn't advertiseplaylist_thumbnails.Reviewed with sol-loop: 3 rounds with gpt-6.1-sol on xhigh.
Sol verdict: approved
Changes made by Claude Opus 5.5 in Claude Code (T3 Code).