message: fix request executor execute() behavior related to topology updates
diff: @@ -150,7 +150,7 @@ export class RequestExecutor implements IDisposable {
  protected _disposed: boolean;
  - protected _firstTopologyUpdatePromise: Promise<void>;
  + protected _firstTopologyUpdatePromise: BluebirdPromise<void>;
  protected _lastKnownUrls: string[];
  @@ -284,9 +284,9 @@ export class RequestExecutor implements IDisposable {
  private _ensureNodeSelector(): Promise<void> {
  let promise: Promise<void> = Promise.resolve();
  - if (this._firstTopologyUpdate
  - && !BluebirdPromise.resolve(this._firstTopologyUpdate).isFulfilled()) {
  - promise = this._firstTopologyUpdatePromise;
  + if (this._firstTopologyUpdatePromise
  + && !this._firstTopologyUpdatePromise.isFulfilled()) {
  + promise = Promise.resolve(this._firstTopologyUpdatePromise);
  }
  return promise.then(() => {
  @@ -496,7 +496,7 @@ export class RequestExecutor implements IDisposable {
  });
  }
  -protected _firstTopologyUpdate (inputUrls: string[]): Promise<void> {
  +protected _firstTopologyUpdate (inputUrls: string[]): BluebirdPromise<void> {
  const initialUrls: string[] = RequestExecutor._validateUrls(inputUrls, this._authOptions);
  const topologyUpdateErrors: Array<{ url: string, error: Error | string }> = [];
  @@ -572,7 +572,7 @@ protected _firstTopologyUpdate (inputUrls: string[]): Promise<void> {
  this._throwExceptions(details);
  });
  - return Promise.resolve(result);
  + return result;
  }
  protected _throwExceptions (details: string): void {
  @@ -621,9 +621,7 @@ protected _firstTopologyUpdate (inputUrls: string[]): Promise<void> {
  this._log.info(`Execute command ${command.constructor.name}`);
  const topologyUpdate = this._firstTopologyUpdatePromise;
  - const isTopologyUpdateFinished = BluebirdPromise.resolve(topologyUpdate).isFulfilled();
  -
  - if ((topologyUpdate && isTopologyUpdateFinished) || this._disableTopologyUpdates) {
  + if ((topologyUpdate && topologyUpdate.isFulfilled()) || this._disableTopologyUpdates) {
  const currentIndexAndNode: CurrentIndexAndNode = this.chooseNodeForRequest(command, sessionInfo);
  return this._executeOnSpecificNode(command, sessionInfo, {
  chosenNode: currentIndexAndNode.currentNode,
  @@ -637,7 +635,7 @@ protected _firstTopologyUpdate (inputUrls: string[]): Promise<void> {
  private _unlikelyExecute<TResult> (
  command: RavenCommand<TResult>,
  - topologyUpdate: Promise<void>,
  + topologyUpdate: BluebirdPromise<void>,
  sessionInfo: SessionInfo): Promise<void> {
  const result = BluebirdPromise.resolve()
  