-
Notifications
You must be signed in to change notification settings - Fork 251
Open
Labels
Description
The calculation and handling of the INSTANCE_START_SORTING
and INSTANCE_DUE_SORTING
values are not clearly defined and unified yet in the code base. To remove the chance of errors around that and help maintain it more easily, consolidate the solution with the steps below.
-
Define the calculation from
DateTime
tolong
at a single place in the code base,
possibly with aTimeSorting implements Single<Long>
class that takes the start/dueDateTime
. (OrTimeSortingValue
,TimeSortingKey
).Current implementation in
org.dmfs.provider.tasks.processors.tasks.instancedata.Dated
is this:dateTime.isAllDay() ? dateTime.getInstance() : dateTime.shiftTimeZone(TimeZone.getDefault()).getInstance()
Consider using
getTimestamp()
instead and consider and test different scenarios (all-day, floating, etc.) -
Replace every usage of the sorting value calculation in the code base with the new class.
-
Add DB upgrade migration procedure to update all existing values using the new calculation.
-
Revisit
org.dmfs.opentaskstestpal.InstanceTestData
class and its usage in the provider tests. If possible move the sorting value calculation inside.