Fix chained conditional task logic #3383
Open
+47
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3248 #3293 #3294
Conditional tasks were not updating correctly when their dependencies were part of a chain. Specifically, if Task C depended on Task B, and Task B depended on Task A:
User selects value in A -> B becomes visible.
User selects value in B -> C becomes visible.
User changes A -> B becomes hidden.
Issue: Task C remained visible because it was still evaluating its condition against Task B's stale data, ignoring the fact that Task B was now hidden/invalid.
Updated TaskSequenceHandler.generateValidTasksList() to iteratively build the list of valid tasks.
When evaluating if a task is valid, the system now only considers data from tasks that have already been determined to be valid in the current sequence.
This ensures that hidden tasks are treated as having no data, correctly propagating the "hidden" state down the dependency chain.
Verified with a local reproduction test case (TaskSequenceHandlerReproTest) simulating the A->B->C dependency chain.
@rfontanarosa @shobhitagarwal1612 PTAL?