next.js
aa6a9bf2 - refactor(turbo-tasks): Check for transient tasks called from persistent tasks in more places (#77760)

Commit
278 days ago
refactor(turbo-tasks): Check for transient tasks called from persistent tasks in more places (#77760) Currently, we only do this check when a transient task is created for the first time. However (e.g. assuming buggy implementations of `TaskInput`, use of `turbo_tasks::State`, etc) it's possible that a persistent function does not create a transient task, but does read from cached data. In these cases, you wouldn't see the issue in development or in most e2e tests. Instead, you'd see panics after cache eviction (not yet on-by-default) or a restart of turbopack (as we cannot persistently cache transient tasks). This tries to catch such potential issues earlier, so that we can catch them before they get to users. This codepath is hot, but the check is very cheap: it's just checking the upper bit of two `u32`s.
Author
bgw bgw
Parents
Loading