@@ -269,22 +269,33 @@ async fn subscribe_issues_and_diags_operation(
269
269
}
270
270
}
271
271
272
+ #[ turbo_tasks:: function( operation) ]
273
+ fn endpoint_client_changed_operation (
274
+ endpoint_op : OperationVc < Box < dyn Endpoint > > ,
275
+ ) -> Vc < Completion > {
276
+ endpoint_op. connect ( ) . client_changed ( )
277
+ }
278
+
272
279
#[ napi( ts_return_type = "{ __napiType: \" RootTask\" }" ) ]
273
280
pub fn endpoint_client_changed_subscribe (
274
281
#[ napi( ts_arg_type = "{ __napiType: \" Endpoint\" }" ) ] endpoint : External < ExternalEndpoint > ,
275
282
func : JsFunction ,
276
283
) -> napi:: Result < External < RootTask > > {
277
284
let turbo_tasks = endpoint. turbo_tasks ( ) . clone ( ) ;
278
- let endpoint = * * * endpoint;
285
+ let endpoint_op = * * * endpoint;
279
286
subscribe (
280
287
turbo_tasks,
281
288
func,
282
289
move || {
283
290
async move {
284
- let changed = endpoint . connect ( ) . client_changed ( ) ;
291
+ let changed_op = endpoint_client_changed_operation ( endpoint_op ) ;
285
292
// We don't capture issues and diagnostics here since we don't want to be
286
293
// notified when they change
287
- changed. strongly_consistent ( ) . await ?;
294
+ //
295
+ // This must be a *read*, not just a resolve, because we need the root task created
296
+ // by `subscribe` to re-run when the `Completion`'s value changes (via equality),
297
+ // even if the cell id doesn't change.
298
+ let _ = changed_op. read_strongly_consistent ( ) . await ?;
288
299
Ok ( ( ) )
289
300
}
290
301
. instrument ( tracing:: info_span!( "client changes subscription" ) )
0 commit comments