Use Tracker as single source of data
Right now there are at least 2 sources of data at runtime for the data:
- the items stored in the manager: used to get the full list of notes
- the data cached in Tracker: used to get a filtered list of notes (during search or by notebook), and the list of notebooks
It has several drawbacks:
- You have to follow the calls to see where the data comes from
- You have to keep both sources updated when a change is made
This is a proposition to only use Tracker as the source of data. It has several advantages:
- When you make a change, you only need to update the tracker data
- You can listen to data changes with TrackerNotifiers to update the controller
- We need it anyway for text searches
- This allows us to provide offline-first support for providers: even if a provider is unreachable or slow, we still use the data in Tracker. This is particularly important on mobile connections.
Drawbacks:
- Same as now: If the cache is reset, we loose the data, but almost everything should be stored locally or online.