Unverified Commit 1ead596c authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: don't panic due to eventual consistency in module merging (#91088)

Turn into bail to handle eventual consistency more gracefully
parent 3ba53df7
...@@ -1525,16 +1525,17 @@ async fn merge_modules( ...@@ -1525,16 +1525,17 @@ async fn merge_modules(
} }
}; };
debug_assert!( if cfg!(debug_assertions) && inserted.len() != contents.len() {
inserted.len() == contents.len(), bail!(
"Not all merged modules were inserted: {:?}", "Not all merged modules were inserted: {:?}",
contents contents
.iter() .iter()
.enumerate() .enumerate()
.map(async |(i, m)| Ok((inserted.contains(&i), m.0.ident().to_string().await?))) .map(async |(i, m)| Ok((inserted.contains(&i), m.0.ident().to_string().await?)))
.try_join() .try_join()
.await?, .await?,
); );
}
let comments = contents let comments = contents
.iter_mut() .iter_mut()
......
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