Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Turbopack] fix unemit collectible #74932

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ impl AggregatedDataUpdate {
for collectible in collectibles {
collectibles_update.push((collectible, 1));
}
collectibles_update.extend(iter_many!(
task,
Collectible {
collectible
} count => {
(collectible, *count)
}
));
}
if let Some(dirty) = get!(task, Dirty) {
dirty_container_count.update_with_dirty_state(dirty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use turbo_tasks::TaskId;
use crate::{
backend::{
operation::{
AggregatedDataUpdate, AggregationUpdateJob, AggregationUpdateQueue, ExecuteContext,
Operation,
get_aggregation_number, is_root_node, AggregatedDataUpdate, AggregationUpdateJob,
AggregationUpdateQueue, ExecuteContext, Operation,
},
storage::{get, update_count},
TaskDataCategory,
Expand All @@ -27,8 +27,34 @@ impl UpdateCollectibleOperation {
// Collectibles are not supported without children tracking
return;
}
let mut queue = AggregationUpdateQueue::new();
let mut task = ctx.task(task_id, TaskDataCategory::All);
if count < 0 {
// Ensure it's an root node
loop {
let aggregation_number = get_aggregation_number(&task);
if is_root_node(aggregation_number) {
break;
}
drop(task);
{
let _span = tracing::trace_span!(
"make root node for removing collectible",
%task_id
)
.entered();
AggregationUpdateQueue::run(
AggregationUpdateJob::UpdateAggregationNumber {
task_id,
base_aggregation_number: u32::MAX,
distance: None,
},
&mut ctx,
);
}
task = ctx.task(task_id, TaskDataCategory::All);
}
}
let mut queue = AggregationUpdateQueue::new();
let outdated = get!(task, OutdatedCollectible { collectible }).copied();
if let Some(outdated) = outdated {
if count > 0 && outdated > 0 {
Expand Down
Loading