The problem occurs in the _translateTaskResult method. This method is called by the createAndSendResult when the task ends. It translates the task RPTaskResult to the locale used during the task.
_translateTaskResult creates a new RPTaskResult to store the translated data. In the process, it introduces 2 problems:
RPTaskResult's startTime changes to the time the new RPTaskResult is created, and it is no longer the time the data was collected (startTime of the original RPTaskResult). This makes it inaccurate.
endTime is never set in the new RPTaskResult, so it becomes null.
I replicated this bug in the example application provided in the package.
I did a quick check and was able to fix it by just setting the startTime and endTime in the new RPTaskResult. I will work on it more carefully and submit a pull request soon.
The problem occurs in the
_translateTaskResult
method. This method is called by thecreateAndSendResult
when the task ends. It translates the taskRPTaskResult
to the locale used during the task._translateTaskResult
creates a newRPTaskResult
to store the translated data. In the process, it introduces 2 problems:RPTaskResult
's startTime changes to the time the newRPTaskResult
is created, and it is no longer the time the data was collected (startTime
of the originalRPTaskResult
). This makes it inaccurate.endTime
is never set in the newRPTaskResult
, so it becomesnull
.I replicated this bug in the example application provided in the package.
I did a quick check and was able to fix it by just setting the
startTime
andendTime
in the newRPTaskResult
. I will work on it more carefully and submit a pull request soon.