18:07
<Andreu Botella>
https://gist.github.com/andreubotella/e061a42b17e4eefcd971aec5c396a9b4
18:17
<Andreu Botella>
if anyone wants to understand how that polyfill works, scheduler.taskId is a property enabled by that Chrome feature flag that is used for testing task attribution
18:19
<Andreu Botella>
basically, any time that (according to task attribution) a context should be propagated, the scheduler.taskId from the time the task gets scheduled gets copied and set on the scheduled task itself
18:19
<Andreu Botella>
even if the task id gets set by JS code
18:20
<Andreu Botella>
and new tasks without a dispatch context get new ID's (starting from 1; 0 being the initial context)
18:20
<Andreu Botella>
so AsyncContext-created contexts get ID's starting at 1000000 to try and avoid clashes