Q:

OAuth Flow not working when using Promise

I am building a simple chrome extension which integrates with Twitter using OAuth. I have slightly modified the Chrome OAuth Tutorial to integrate with Twitter. The extension is build in Reactjs+Flux. 
When the user clicks on "Sign in with Twitter" button, an Action signin is triggered, which is declared as follows:
signin: function(){
    ChromeUtils.connecttotwitter().then(alert("Step After Then"));       
    AppDispatcher.dispatch({actionType:TweetSmartActions.SIGN_IN,signedInTwitterUserId: response.user_id});
},

The ChromeUtils.connecttotwitter() is defined as follows:
var ChromeUtils = {

    connecttotwitter: function () {

        return new Promise(function(fulfill,reject){
            var request = {
                type : "background.twitterRequestToken",
            };
            alert("Before sendMessage");
            chrome.runtime.sendMessage(request, function(response) {

                if (response)
                {
                    fulfill(response);
                }
                else
                {
                    reject(response);
                }
            });
        });
    },

And the event listener onMessage is defined in the background.js as: 
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {

    console.log("background.js: " + JSON.stringify(request));

    var type = request.type;

    if (type == "background.twitterRequestToken")
    {
        oauth.authorize(function(token,secret,userId,screenname){
            sendResponse({success:true,userId:userId,screenName:screenname});
        });
        alert("Alerting before returning true");
        return true;
    }

When I click on the "Sign In With Twitter" button, the authentication flow does start and a new page opens. However, after I introduced the Promise, the new page does not redirect to the twitter oauth page. In fact, to debug that I have put the following alert statements in chrome_ex_oauth.js:
ChromeExOAuth.prototype.initOAuthFlow = function(callback) {
  if (!this.hasToken()) {
    var params = ChromeExOAuth.getQueryStringParams();
    if (params['chromeexoauthcallback'] == 'true') {
      var oauth_token = params['oauth_token'];
      var oauth_verifier = params['oauth_verifier']
      this.getAccessToken(oauth_token, oauth_verifier, callback);
    } else {
      var request_params = {
        'url_callback_param' : 'chromeexoauthcallback'
      }
      this.getRequestToken(function(url) {
        alert("Url after get request token " + url);
        window.location.href = url;
        alert(window.location.href);
      }, request_params);
    }

Here, the url in the first alert is the twitter oauth url but the second alert gives the Chrome extension Url - 
chrome-extension://kiekipigbdldhggmlohbnhofnjhcbmem/chrome_ex_oauth.html

Why did the url not get assigned to window.location.href? 
Any ideas on what might be happening?

A:

The issue was not because I was using a Promise, but because when using Flux, the Action was being Dispatched before the response from the Promise was received and this was causing the app to hang somehow 
signin: function(){
    ChromeUtils.connecttotwitter().then(alert("Step After Then"));       
    AppDispatcher.dispatch({actionType:TweetSmartActions.SIGN_IN,signedInTwitterUserId: response.user_id});
},

In the above, the AppDispatcher.dispatch should be called in the function which is invoked on then. 

