fix: add eventEmitter on libraryCommand#5768
Conversation
| properties, | ||
| measurements | ||
| ); | ||
| LibraryCommandletExecutor.libraryCommandCompletionEventEmitter.fire(!!success); |
There was a problem hiding this comment.
Not sure if it is meaningful. LibraryCommandletExecutor is an abstract class to be extended by other real executors such as orgLogoutDefault or orgLoginAccessToken. How does the subscriber know the result from which command it is listening to with only a boolean value? Can you help me understand that? @angelamuliu @peternhale
There was a problem hiding this comment.
Great catch @mingxuanzhangsfdx, there is no way to know. If two commands are run concurrently and are listening for the completion event, knowing which event belongs any given listener is indeterminant.
| properties, | ||
| measurements | ||
| ); | ||
| LibraryCommandletExecutor.libraryCommandCompletionEventEmitter.fire(!!success); |
There was a problem hiding this comment.
Great catch @mingxuanzhangsfdx, there is no way to know. If two commands are run concurrently and are listening for the completion event, knowing which event belongs any given listener is indeterminant.
|
@angelamuliu This PR cannot move forward due to concurrency issues. |
What does this PR do?
Adds event emitter "onLibraryCommandCompletion" (accessible via CommandEventDispatcher) that fires a boolean regarding whether a library command succeeded or failed.
What issues does this PR fix or reference?
@W-16420054@
Functionality Before
Before there was no way of knowing if a library command (such as deploy) succeeded or failed.
Functionality After
Consumer can subscribe to onLibraryCommandCompletion event and understand whether command succeeded or failed.