We will likely need to rewrite the sync logic when we replace the service for storing user data. A few ideas when we shape up the new service and framework implementation:
We should be able to store basic metadata with entries (e.g. video or audio content, TV or radio channel, title, image, etc.). This would make it easier to filter the content, because we currently need to perform a server request to fetch the complete metadata and this creates additional issues (performance, pagination support, etc.)
We should improve how the framework broadcasts changes. Currently we cannot know if something changed without querying the storage, which can be heavy. Maybe being able to quickly deliver snapshots of what changed (similar to snapshots used for collection or table data sources) would allow us to apply changes in a more efficient way.
We should probably use modern tools (Swift, Combine) to write code in a more efficient and reliable way. This includes throttling strategies so that updates are not always immediately delivered to the client, most notably during background sync. User-driven changes should be immediately delivered, though, so that the UI can respond immediately to user interactions on user data.
Actors and async / await could also be helpful (iOS and tvOS 15+, though). Throttling strategies would be more difficult to implement, but maybe we could use pipelines for the data delivery, while using actors and async / await for local storage management (e.g. preference log).
Consequences of the current limitations in the Play application:
Synchronized paginated lists (favorites grid, history grid, etc.) cannot be updated automatically (as more metadata needs to be requested with additional requests). A pull-to-refresh is needed.
History updates are costly. For this reason the watch later swimlane is not updated automatically with each history change, as this would require querying the Core Data storage with each update notification, which is battery-heavy.
We will likely need to rewrite the sync logic when we replace the service for storing user data. A few ideas when we shape up the new service and framework implementation: