title: flatMap Not returning onCompleted
body: <p>I have created below function with chaining of multiple observables however whatever I do it does not seem to call <code>completed</code> ? it only return the following:</p>
  
  <pre><code>(facebookSignInAndFetchData()) -&gt; subscribed
  (facebookSignInAndFetchData()) -&gt; Event next(())
  </code></pre>
  
  <p>even though when I <code>debug</code> the observables individually they all return <code>completed</code></p>
  
  <p>here is my chaining function</p>
  
  <pre><code>func facebookSignInAndFetchData() {
  
  
      observerFacebook.flatMap { (provider: FacebookProvider) in
          return provider.login()
          }.flatMap { token in
              return self.loginViewModel.rx_authenticate(token: token)
          }.flatMap {
              return self.loginViewModel.fetchProfileData()
          }.debug().subscribe(onError: { error in
  
              //Guard unknown ErrorType
              guard let err = error as? AuthError else {
                  //Unknown error message
                  self.alertHelper.presentAlert(L10n.unknown)
                  return
              }
  
              //error message handling
              switch err {
              case .notLoggedIn:
                  print("not logged in")
                  break
              default:
                  self.alertHelper.presentAlert(err.description)
              }
  
          }, onCompleted: {
              self.goToInitialController()
          }).addDisposableTo(self.disposeBag)
  
  }
  </code></pre>
  
  <p><strong>rx_authenticate</strong></p>
  
  <pre><code>func rx_authenticate(token: String) -&gt; Observable&lt;Void&gt; {
  
  
      return Observable.create({ observer in
          let credentials = SyncCredentials.facebook(token: token)
          SyncUser.logIn(with: credentials, server: URL(string: Globals.serverURL)!, onCompletion: { user, error in
  
              //Error while authenticating
              guard error == nil else {
                  print("error while authenticating: \(error!)")
                  observer.onError(AuthError.unknown)
                  return
              }
  
              //Error while parsing user
              guard let responseUser = user else {
                  print("error while authenticating: \(error!)")
                  observer.onError(AuthError.unknown)
                  return
              }
  
              //Authenticated
              setDefaultRealmConfiguration(with: responseUser)
  
              //next
              observer.onNext()
  
              //completed
              observer.onCompleted()
  
  
          })
  
          return Disposables.create()
      })
  }
  </code></pre>
  
  <p><strong>fetchProfileData</strong></p>
  
  <pre><code>func fetchProfileData() -&gt; Observable&lt;Void&gt; {
  
       return Observable.create({ observer in
  
          //Fetch facebookData
          let params = ["fields" : "name, picture.width(480)"]
          let graphRequest = GraphRequest(graphPath: "me", parameters: params)
          graphRequest.start {
              (urlResponse, requestResult) in
              switch requestResult {
              case .failed(_):
                  //Network error
                  observer.onError(AuthError.noConnection)
                  break
              case .success(let graphResponse):
  
                  if let responseDictionary = graphResponse.dictionaryValue {
  
                      guard let identity = SyncUser.current?.identity else {
                          //User not logged in
                          observer.onError(AuthError.noUserIdentity)
                          return
                      }
  
                      //Name
                      let name = responseDictionary["name"] as! String
  
                      //Image dictionary
                      let pictureDic = responseDictionary["picture"] as! [String: Any]
                      let dataDic = pictureDic["data"] as! [String: Any]
                      let imageHeight = dataDic["height"] as! Int
                      let imageWidth = dataDic["width"] as! Int
                      let url = dataDic["url"] as! String
  
                      //Create Person object
                      let loggedUser = Person()
                      loggedUser.id = identity
                      loggedUser.name = name
  
                      //Create photo object
                      let photo = Photo()
                      photo.height = imageHeight
                      photo.width = imageWidth
                      photo.url = url
  
                      //Append photo object to person object
                      loggedUser.profileImage = photo
  
                      //Save userData
                      let realm = try! Realm()
                      try! realm.write {
                          realm.add(loggedUser, update: true)
                      }
  
                      //next
                      observer.onNext()
  
                      //completed
                      observer.onCompleted()
  
                  } else {
                      //Could not retrieve responseData
                      observer.onError(AuthError.noResponse)
                  }
              }
          }
  
  
  
          return Disposables.create()
      })
  
  
  }
  </code></pre>
  
  <p><strong>observerFacebook</strong></p>
  
  <pre><code>//FacebookProvider
  private lazy var observerFacebook: Observable&lt;FacebookProvider&gt;! = {
      self.facebookButton.rx.tap.map {
  
          return FacebookProvider(parentController: self)
      }
  }()
  </code></pre>