File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
turbopack/crates/turbo-tasks-backend/src/backend/operation Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,15 @@ impl UpdateCellOperation {
64
64
// To avoid a race condition, we need to remove the old content first,
65
65
// then invalidate dependent tasks and only then update the cell content.
66
66
67
+ // The reason behind this is that we consider tasks that haven't the dirty flag set
68
+ // as "recomputing" tasks. Recomputing tasks won't invalidate
69
+ // dependent tasks, when a cell is changed. This would cause missing invalidating if
70
+ // a task is recomputing while a dependency is in the middle of a cell update (where
71
+ // the value has been changed, but the dependent tasks have not be flagged dirty
72
+ // yet). So to avoid that we first remove the cell content, invalidate all dependent
73
+ // tasks and after that set the new cell content. When the cell content is unset,
74
+ // readers will wait for it to be set via InProgressCell.
75
+
67
76
let old_content = task. remove ( & CachedDataItemKey :: CellData { cell } ) ;
68
77
69
78
drop ( task) ;
You can’t perform that action at this time.
0 commit comments