Description
In context.py lines 70-75, the task_id setter treats 0 as falsy. Since not 0 is True, the setter overwrites a valid task_id=0 with whatever value is passed, including None.
Location
dotflow/core/context.py:70-75
@task_id.setter
def task_id(self, value: int):
if isinstance(value, int):
self._task_id = value
if not self.task_id: # not 0 == True
self._task_id = value
Impact
The first task in every workflow (task_id=0) has its ID incorrectly handled. If value=None is passed later, it overwrites the valid 0.
Fix
Change if not self.task_id: to if self._task_id is None:.
Severity
Critical
Description
In
context.pylines 70-75, thetask_idsetter treats0as falsy. Sincenot 0isTrue, the setter overwrites a validtask_id=0with whatever value is passed, includingNone.Location
dotflow/core/context.py:70-75Impact
The first task in every workflow (task_id=0) has its ID incorrectly handled. If
value=Noneis passed later, it overwrites the valid0.Fix
Change
if not self.task_id:toif self._task_id is None:.Severity
Critical