Implement Sync Device API #6
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Chewing_Bever/otter#6
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
The Sync Device API configures which devices are synchronised. Devices are part of a sync group, and all changes to subscriptions on a device are also performed on all other devices in the same sync group. If two devices are already in separate sync groups and they're marked as "synchronize", their sync groups should be merged inton one big group.
Subscriptions should still be stored per device instead of a per sync group as different devices can have different
time_changed
values for subscriptions.Todo
My initial assumption seemed to be incorrect. The source code of the original GPodder.net server seems to imply the API allows defining which devices sync with which other devices. It's not simply a boolean flag.
The way I understand it (by reading the Gpodder source code):
Each device can be part of a "sync group". Devices in the same sync group are synchronized, which for the Gpodder.net server means the backend performs some sort of sync between the devices. That probably doesn't matter much for this server.
This API request means "synchronize devices
notebook
andnetbook
and stop synchronizing the devicepc-work
". With "synchronize devices", this means to add both devices to the same sync group. If both devices are already in a sync group, the sync groups are merged into a single group. The "stop-synchronize" devices should simply be removed from their sync group.The above response is then obtained by grouping the devices by their sync group.
The sync API seems to be crucial for clients to properly sync with each other.
The
sync-device
API routes allow specifying which devices should be part of the same sync group. When this happens, a full sync of the devices should be performed server-side. Any time a subscription is added or removed, this change should be applied to all devices in the same sync group as the target device.Considering it's more common (I'd expect) to keep devices in the same sync group, it might be better to switch our database model to linking subscriptions to sync groups instead of devices. Subscriptions would be added to and removed from the device's sync group, and any queries would be performed on the sync group instead. This would make joining and splitting sync groups a bit harder though.