You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue with this signature is that implementer get a TaskView as input of their task, while they should only need the TaskView.properties. By providing the full TaskView<?> taskView to the implementer, we give the task implementer control over the taskView state. In particular implementers can access setError, setResult which should only be called by the datashare-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:
make setResult, setError and other side effect methods package private so that only datashare-tasks can use them
update the TaskFactoryHelper.createTaskCallable to pass only the TaskView.properties
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: