Skip to content

Commit 5aa9e21

Browse files
Revert change that causes a race condition on mac
1 parent 02c892b commit 5aa9e21

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

libs/idl/idl-process/src/lib/wrappers/idl-std-io-wrapper.class.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,23 @@ export class IDLStdIOWrapper {
132132
}
133133
}
134134

135-
// emit that the IDL prompt is ready
136-
this.process.emit(IDL_EVENT_LOOKUP.PROMPT_READY, {
137-
idlOutput: this.process.capturedOutput,
138-
});
139-
140-
// /**
141-
// * setTimeout solves a race condition where the default case comes through after
142-
// * the prompt does which means we miss out on content coming back to the first process.
143-
// */
144-
// setTimeout(() => {
135+
// // emit that the IDL prompt is ready
145136
// this.process.emit(IDL_EVENT_LOOKUP.PROMPT_READY, {
146137
// idlOutput: this.process.capturedOutput,
147138
// });
148-
// }, 50);
139+
140+
/**
141+
* setTimeout solves a race condition where the default case comes through after
142+
* the prompt does which means we miss out on content coming back to the first process.
143+
*
144+
* This was removed in place of the code just above, but added back in because, without it,
145+
* this race condition on Mac causes us to miss IDL output in some cases.
146+
*/
147+
setTimeout(() => {
148+
this.process.emit(IDL_EVENT_LOOKUP.PROMPT_READY, {
149+
idlOutput: this.process.capturedOutput,
150+
});
151+
}, 50);
149152
}
150153
break;
151154

0 commit comments

Comments
 (0)