Open ClemDoum opened 5 months ago
This issue is stale because it has been open for 40 days with no activity.
This issue is stale because it has been open for 40 days with no activity.
This issue is stale because it has been open for 40 days with no activity.
Current behavior
Today, the signature of
TaskFactoryHelper.createTaskCallable
is:The issue with this signature is that implementer get a
TaskView
as input of their task, while they should only need theTaskView.properties
. By providing the fullTaskView<?> taskView
to the implementer, we give the task implementer control over thetaskView
state. In particular implementers can accesssetError
,setResult
which should only be called by thedatashare-tasks
codebase.Expected behavior and potential solutions
Task implementer should not be allowed to update the task state as this can have detrimental side effects.
Potential solutions:
setResult
,setError
and other side effect methods package private so that onlydatashare-tasks
can use themTaskFactoryHelper.createTaskCallable
to pass only theTaskView.properties