[proxy] github.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Logged Out Between Sessions [TVOS]

JPKribs

After an extended period or storage becomes low on the Apple TV, all Swiftfin user data is wiped. As a result, the user is required to log back into the device.

This occurs because Swiftfin utilizes CoreStore and Core Data. To prevent this issue, data should be moved to NSUserDefaults per:

Source

On iOS/iPadOS & macOS, Core Data is preserved and stored as Application Data. tvOS does not allow Application Data outside of NSUserDefaults. This means that tvOS will either need a separate storage implementation than iOS or iOS will need to be moved to NSUserDefaults. iOS benefits greatly from Core Data's structure and migration features. This is especially helpful for multi-user support and per-user settings. Additionally, fully moving to NSUserDefaults comes with a 500kb limit.

In my opinion (not representative of the project as a whole) the most likely implementation will be core settings moving to NSUserDefaults and we can preserve larger settings to Core Data like Downloads, Custom Device Profiles, etc. This helps us stay under the 500kb limitation at the cost that some less storage-defined solutions will become iOS exclusive.


Since this is a fundamental change to how data data is stored and used in Swiftfin, we will want to plan out a full solution in advance.