File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
packages/compute-protocol Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @blink-sdk/compute-protocol" ,
33 "description" : " The compute protocol for the Blink SDK." ,
4- "version" : " 0.0.6 " ,
4+ "version" : " 0.0.7 " ,
55 "type" : " module" ,
66 "keywords" : [
77 " blink" ,
Original file line number Diff line number Diff line change @@ -640,11 +640,16 @@ export class Server {
640640 } , payload . timeout_ms ) ;
641641 }
642642
643- const end = ( ) => {
643+ const end = async ( ) => {
644644 if ( ended ) {
645645 return ;
646646 }
647647 ended = true ;
648+ // This is janky, but it seems like there's a single tick
649+ // between when output is available _sometimes_. If we don't
650+ // do this, semi-occasionally the plain output will be incorrect.
651+ // TODO: ensure all process output is written before this function is called instead of a sleep
652+ await new Promise ( ( resolve ) => setTimeout ( resolve , 50 ) ) ;
648653 if ( onOutput ) {
649654 onOutput . dispose ( ) ;
650655 }
@@ -703,12 +708,7 @@ export class Server {
703708 }
704709 } ) ;
705710 onExit = process . onExit ( ( ) => {
706- // This is janky, but it seems like there's a single tick
707- // between when output is available _sometimes_. If we don't
708- // do this, semi-occasionally the plain output will be incorrect.
709- setTimeout ( ( ) => {
710- end ( ) ;
711- } , 10 ) ;
711+ end ( ) ;
712712 } ) ;
713713
714714 signal . addEventListener ( "abort" , ( ) => {
You can’t perform that action at this time.
0 commit comments