diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 00fa2a3cf7..ef44bb402f 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -146,7 +146,8 @@ var awApp = angular.module('awApp', [ .constant('AngularScheduler.showUTCField', true) .constant('$timezones.definitions.location', urlPrefix + 'lib/angular-tz-extensions/tz/data') .config(['$logProvider', function($logProvider) { - $logProvider.debugEnabled($ENV['ng-debug'] || false); + // $logProvider.debugEnabled($ENV['ng-debug'] || false); + $logProvider.debugEnabled(true); }]) .config(['ngToastProvider', function(ngToastProvider) { ngToastProvider.configure({ diff --git a/awx/ui/client/src/shared/socket/socket.service.js b/awx/ui/client/src/shared/socket/socket.service.js index bb52260c87..3b117dd3e1 100644 --- a/awx/ui/client/src/shared/socket/socket.service.js +++ b/awx/ui/client/src/shared/socket/socket.service.js @@ -27,7 +27,7 @@ export default if (!$rootScope.sessionTimer || ($rootScope.sessionTimer && !$rootScope.sessionTimer.isExpired())) { $log.debug('Socket connecting to: ' + url); - + console.log("prior to new ReconnectingWebSocket..., self.socket is: " + self.socket); self.socket = new ReconnectingWebSocket(url, null, { timeoutInterval: 3000, maxReconnectAttempts: 10 }); @@ -77,6 +77,9 @@ export default $log.debug('Received From Server: ' + e.data); var data = JSON.parse(e.data), str = ""; + if(_.has(data, "accept") && data.accept === true){ + console.log('handshake message received from server. readyState: '+ this.readyState, data); + } if(data.group_name==="jobs" && !('status' in data)){ // we know that this must have been a // summary complete message b/c status is missing. @@ -126,8 +129,11 @@ export default // listen for specific messages. A subscription object could // look like {"groups":{"jobs": ["status_changed", "summary"]}. // This is used by all socket-enabled $states - this.emit(JSON.stringify(state.data.socket)); - this.setLast(state); + let self = this; + socketPromise.promise.then(function(){ + self.emit(JSON.stringify(state.data.socket)); + self.setLast(state); + }); }, unsubscribe: function(state){ // Unsubscribing tells the API that the user is no longer on