Unverified Commit d5f9cfb3 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: read project strongly consistent in project_update (#83974)

### What?

Once tasks should read all cells strongly consistent, but `project()` was not read strongly consistent.

* read project strongly consistent in project_update
parent c0a1a32c
...@@ -289,6 +289,11 @@ impl ProjectContainer { ...@@ -289,6 +289,11 @@ impl ProjectContainer {
} }
} }
#[turbo_tasks::function(operation)]
fn project_operation(project: ResolvedVc<ProjectContainer>) -> Vc<Project> {
project.project()
}
#[turbo_tasks::function(operation)] #[turbo_tasks::function(operation)]
fn project_fs_operation(project: ResolvedVc<Project>) -> Vc<DiskFileSystem> { fn project_fs_operation(project: ResolvedVc<Project>) -> Vc<DiskFileSystem> {
project.project_fs() project.project_fs()
...@@ -344,7 +349,8 @@ impl ProjectContainer { ...@@ -344,7 +349,8 @@ impl ProjectContainer {
preview_props, preview_props,
} = options; } = options;
let this = self.await?; let resolved_self = self.to_resolved().await?;
let this = resolved_self.await?;
let mut new_options = this let mut new_options = this
.options_state .options_state
...@@ -386,7 +392,9 @@ impl ProjectContainer { ...@@ -386,7 +392,9 @@ impl ProjectContainer {
// TODO: Handle mode switch, should prevent mode being switched. // TODO: Handle mode switch, should prevent mode being switched.
let watch = new_options.watch; let watch = new_options.watch;
let project = self.project().to_resolved().await?; let project = project_operation(resolved_self)
.resolve_strongly_consistent()
.await?;
let prev_project_fs = project_fs_operation(project) let prev_project_fs = project_fs_operation(project)
.read_strongly_consistent() .read_strongly_consistent()
.await?; .await?;
...@@ -395,7 +403,9 @@ impl ProjectContainer { ...@@ -395,7 +403,9 @@ impl ProjectContainer {
.await?; .await?;
this.options_state.set(Some(new_options)); this.options_state.set(Some(new_options));
let project = self.project().to_resolved().await?; let project = project_operation(resolved_self)
.resolve_strongly_consistent()
.await?;
let project_fs = project_fs_operation(project) let project_fs = project_fs_operation(project)
.read_strongly_consistent() .read_strongly_consistent()
.await?; .await?;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment