This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
#51: Implement PropertiesStorage for storing user-defined metadata #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #51 for the context.
Limitations:
PropertiesStorage
is tailored for theProperties
structure, which currently includes two fields:title
anddescription
. This is primarily beneficial for ARK Shelf at the moment. While theProperties
class can be expanded by app developers, they would need to create their own version ofPropertiesStorage
to handle the custom structure. We aim to enhancePropertiesStorage
in the future to manage third-party extensions without needing to duplicate the entire code within the app (see Enabling app developers to extend the Properties class #78).Fields of the
Properties
structure are typed asSet<T>
due to potential conflicts from other devices, similar to other user data storages likeTagStorage
orScoreStorage
. We employ the simplest possible conflict resolution, known as Monoid, by consolidating all versions into a set. It's important to note, we do not guarantee the possibility of removing values from storages if the user has the app open on other devices (as the removed values will simply reappear). To eliminate redundant values and retain only the canonical value for a resource R, the user needs to close all app instances except one and input the canonical value on it. This compromise seems fair as we prioritize data safety. See Tracked storage and CRDT #58 for the future work.