From c0a72901ed60d578168edbd8b9769a8fc0d23328 Mon Sep 17 00:00:00 2001 From: Ben Schwartz Date: Wed, 19 Aug 2015 16:24:40 -0400 Subject: [PATCH 1/4] Add auto-retry on connection failure. Partially fixes #1825 --- src/generic_ui/locales/en/messages.json | 10 +++------- src/generic_ui/polymer/root.html | 5 ++++- src/generic_ui/scripts/ui.ts | 4 ++++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/generic_ui/locales/en/messages.json b/src/generic_ui/locales/en/messages.json index 9c52e1f61d..dbd9f934e9 100644 --- a/src/generic_ui/locales/en/messages.json +++ b/src/generic_ui/locales/en/messages.json @@ -389,11 +389,11 @@ }, "DISCONNECTED_TITLE": { "description": "Title for error that appears when the user was getting access to the Internet through their friend, but that connection was terminated.", - "message": "Oops! You've been disconnected from your friend." + "message": "Oops! You've been disconnected from your friend. Reconnecting..." }, "DISCONNECTED_MESSAGE": { - "description": "Instruction informing the user that to continue browsing the Internet, the user will need to use their local (potentially unsafe and/or censored) connection.", - "message": "Please proceed with caution. Your web traffic will no longer be routed through your friend. You may want to close any sensitive windows you have open, before proceeding." + "description": "Instruction informing the user that if they want to browse the Internet and stop waiting for reconnection, the user will need to use their local (potentially unsafe and/or censored) connection.", + "message": "If you disable the proxy, your web traffic will no longer be routed through your friend. You may want to close any sensitive pages you have open, before proceeding." }, "CONTINUE_BROWSING": { "description": "Label for button that will change the users Internet settings back to using the user's local connection (i.e. not their friend's Internet).", @@ -675,10 +675,6 @@ "description": "Shown in Chrome to instruct the user to install part 2 of uProxy.", "message": "Download and enable part 2 of uProxy to get started." }, - "RESTART_PROXYING": { - "description": "If proxy connection gets disconnected restart the connection", - "message": "Reconnect" - }, "UPDATE_AVAILABLE": { "description": "What to show the user (on the bottom bar) when an update is available. The actual update will not be done until they restart uProxy which we will prompt them to do with a link.", "message": "An update is available" diff --git a/src/generic_ui/polymer/root.html b/src/generic_ui/polymer/root.html index 68294e2554..3765fc83a2 100644 --- a/src/generic_ui/polymer/root.html +++ b/src/generic_ui/polymer/root.html @@ -190,6 +190,9 @@ #disconnectDialog paper-button { font-size: 12px; } + #progressWrapper { + text-align: center; + } paper-toast { position: fixed; left: 12px; @@ -375,12 +378,12 @@

{{ "WELCOME" | $$ }}

{{ "DISCONNECTED_TITLE" | $$ }}

+

{{ "DISCONNECTED_MESSAGE" | $$ }}

{{ "CONTINUE_BROWSING" | $$ }} - {{ 'RESTART_PROXYING' | $$ }} diff --git a/src/generic_ui/scripts/ui.ts b/src/generic_ui/scripts/ui.ts index 0dab4c7f41..9cdfac5aec 100644 --- a/src/generic_ui/scripts/ui.ts +++ b/src/generic_ui/scripts/ui.ts @@ -589,6 +589,10 @@ export class UserInterface implements ui_constants.UiApi { if (data.error) { this.bringUproxyToFront(); this.core.disconnectedWhileProxying = true; + if (this.instanceGettingAccessFrom_) { + // Auto-retry. + this.restartProxying(); + } } else { this.core.disconnectedWhileProxying = false; if (data.instanceId === null || From a45ff8c47a4f67034a47432d51064cfaea35856b Mon Sep 17 00:00:00 2001 From: Ben Schwartz Date: Thu, 20 Aug 2015 18:54:37 -0400 Subject: [PATCH 2/4] Improve reconnect logic --- src/generic_ui/locales/en/messages.json | 14 ++++++++++++- src/generic_ui/polymer/instance.ts | 1 + src/generic_ui/polymer/root.html | 11 +++++++++- src/generic_ui/polymer/root.ts | 1 + src/generic_ui/scripts/ui.ts | 27 ++++++++++++++++++------- 5 files changed, 45 insertions(+), 9 deletions(-) diff --git a/src/generic_ui/locales/en/messages.json b/src/generic_ui/locales/en/messages.json index dbd9f934e9..7c9cb49be7 100644 --- a/src/generic_ui/locales/en/messages.json +++ b/src/generic_ui/locales/en/messages.json @@ -389,7 +389,7 @@ }, "DISCONNECTED_TITLE": { "description": "Title for error that appears when the user was getting access to the Internet through their friend, but that connection was terminated.", - "message": "Oops! You've been disconnected from your friend. Reconnecting..." + "message": "Oops! You've been disconnected from your friend." }, "DISCONNECTED_MESSAGE": { "description": "Instruction informing the user that if they want to browse the Internet and stop waiting for reconnection, the user will need to use their local (potentially unsafe and/or censored) connection.", @@ -675,6 +675,18 @@ "description": "Shown in Chrome to instruct the user to install part 2 of uProxy.", "message": "Download and enable part 2 of uProxy to get started." }, + "RECONNECTING": { + "description": "Indicate that uProxy is attempting to reconnect automatically after a failure. A progress indicator is also visible.", + "message": "Reconnecting..." + }, + "RECONNECT_FAILED": { + "description": "Indicate that uProxy attempted to reconnect automatically but it failed.", + "message": "Reconnect failed" + }, + "RESTART_PROXYING": { + "description": "Displayed on a button next to the RECONNECT_FAILED message", + "message": "Try again" + }, "UPDATE_AVAILABLE": { "description": "What to show the user (on the bottom bar) when an update is available. The actual update will not be done until they restart uProxy which we will prompt them to do with a link.", "message": "An update is available" diff --git a/src/generic_ui/polymer/instance.ts b/src/generic_ui/polymer/instance.ts index 608ec54a5e..2cc44c7451 100644 --- a/src/generic_ui/polymer/instance.ts +++ b/src/generic_ui/polymer/instance.ts @@ -29,6 +29,7 @@ Polymer({ }); }, stop: function() { + ui.stopUsingProxy(); ui.stopGettingFromInstance(this.instance.instanceId); } }); diff --git a/src/generic_ui/polymer/root.html b/src/generic_ui/polymer/root.html index 3765fc83a2..3a9a9761bd 100644 --- a/src/generic_ui/polymer/root.html +++ b/src/generic_ui/polymer/root.html @@ -378,7 +378,16 @@

{{ "WELCOME" | $$ }}

{{ "DISCONNECTED_TITLE" | $$ }}

-
+
+
+

{{ 'RECONNECTING' | $$ }}

+ +
+
+ {{ 'RECONNECT_FAILED' | $$ }} + {{ 'RESTART_PROXYING' | $$ }} +
+

{{ "DISCONNECTED_MESSAGE" | $$ }}

diff --git a/src/generic_ui/polymer/root.ts b/src/generic_ui/polymer/root.ts index 970f246393..e894be1b44 100644 --- a/src/generic_ui/polymer/root.ts +++ b/src/generic_ui/polymer/root.ts @@ -167,6 +167,7 @@ Polymer({ } }, revertProxySettings: function() { + this.ui.stopUsingProxy(); this.ui.stopGettingInUiAndConfig({instanceId: null, error: false}); }, restartProxying: function() { diff --git a/src/generic_ui/scripts/ui.ts b/src/generic_ui/scripts/ui.ts index 9cdfac5aec..76b4eb1eb3 100644 --- a/src/generic_ui/scripts/ui.ts +++ b/src/generic_ui/scripts/ui.ts @@ -369,11 +369,13 @@ export class UserInterface implements ui_constants.UiApi { (info:uproxy_core_api.FailedToGetOrGive) => { console.error('proxying attempt ' + info.proxyingId + ' failed (getting)'); - this.toastMessage = this.i18n_t("UNABLE_TO_GET_FROM", { - name: info.name - }); + if (!this.proxySet_) { + this.toastMessage = this.i18n_t("UNABLE_TO_GET_FROM", { + name: info.name + }); + this.unableToGet = true; + } this.instanceTryingToGetAccessFrom = null; - this.unableToGet = true; this.proxyingId = info.proxyingId; this.bringUproxyToFront(); }); @@ -582,6 +584,9 @@ export class UserInterface implements ui_constants.UiApi { public stopGettingInUiAndConfig = (data :social.StopProxyInfo) => { if (data.instanceId) { this.mapInstanceIdToUser_[data.instanceId].isSharingWithMe = false; + + // Possibly redundant. + this.core.stop(this.getInstancePath_(this.instanceGettingAccessFrom_)); } else if (this.instanceGettingAccessFrom_) { this.mapInstanceIdToUser_[this.instanceGettingAccessFrom_].isSharingWithMe = false; } @@ -593,12 +598,11 @@ export class UserInterface implements ui_constants.UiApi { // Auto-retry. this.restartProxying(); } - } else { - this.core.disconnectedWhileProxying = false; + } else if (!this.proxySet_) { if (data.instanceId === null || data.instanceId === this.instanceGettingAccessFrom_) { this.instanceGettingAccessFrom_ = null; - this.browserApi.stopUsingProxy(); + this.core.disconnectedWhileProxying = false; } } @@ -606,6 +610,11 @@ export class UserInterface implements ui_constants.UiApi { this.updateIcon_(); } + public stopUsingProxy = () => { + this.browserApi.stopUsingProxy(); + this.proxySet_ = false; + } + private getInstancePath_ = (instanceId :string) => { var user = this.mapInstanceIdToUser_[instanceId]; @@ -636,6 +645,9 @@ export class UserInterface implements ui_constants.UiApi { this.core.stop(this.getInstancePath_(this.instanceGettingAccessFrom_)); } this.startGettingInUiAndConfig(instanceId, endpoint); + }, (err:Error) => { + this.instanceTryingToGetAccessFrom = null; + throw err; }); } @@ -675,6 +687,7 @@ export class UserInterface implements ui_constants.UiApi { this.updateGettingStatusBar_(); this.browserApi.startUsingProxy(endpoint); + this.proxySet_ = true; } /** From 59ffed7a6bab6e0c40005e51e25720bf2068acf5 Mon Sep 17 00:00:00 2001 From: Ben Schwartz Date: Fri, 21 Aug 2015 16:25:49 -0400 Subject: [PATCH 3/4] General cleanup --- .../scripts/chrome_core_connector.spec.ts | 8 ++--- src/generic_ui/polymer/root.html | 2 +- src/generic_ui/polymer/root.ts | 1 - src/generic_ui/scripts/ui.spec.ts | 12 +++++-- src/generic_ui/scripts/ui.ts | 33 ++++++++++++------- 5 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/chrome/extension/scripts/chrome_core_connector.spec.ts b/src/chrome/extension/scripts/chrome_core_connector.spec.ts index b0f1984dbd..c68c21ce39 100644 --- a/src/chrome/extension/scripts/chrome_core_connector.spec.ts +++ b/src/chrome/extension/scripts/chrome_core_connector.spec.ts @@ -172,23 +172,23 @@ describe('core-connector', () => { it('show disconnect.html if user was proxying when app disconnects.', (done) => { var uiIsGettingAccessSpy = spyOn(ui, 'isGettingAccess'); - var uiStopGettingInUiAndConfigSpy = spyOn(ui, 'stopGettingInUiAndConfig'); + var uiStoppedGettingSpy = spyOn(ui, 'stoppedGetting'); connectToApp().then(() => { spyOn(chromeCoreConnector, 'connect').and.callFake(() => { done(); }); uiIsGettingAccessSpy.and.callFake(() => { return true; }); disconnect(); - expect(uiStopGettingInUiAndConfigSpy).toHaveBeenCalled(); + expect(uiStoppedGettingSpy).toHaveBeenCalled(); }); }); it('do not show disconnect.html if user was not proxying when app disconnects.', (done) => { var uiIsGettingAccessSpy = spyOn(ui, 'isGettingAccess'); - var uiStopGettingInUiAndConfigSpy = spyOn(ui, 'stopGettingInUiAndConfig'); + var uiStoppedGettingSpy = spyOn(ui, 'stoppedGetting'); connectToApp().then(() => { spyOn(chromeCoreConnector, 'connect').and.callFake(() => { done(); }); uiIsGettingAccessSpy.and.callFake(() => { return false; }); disconnect(); - expect(uiStopGettingInUiAndConfigSpy).not.toHaveBeenCalled(); + expect(uiStoppedGettingSpy).not.toHaveBeenCalled(); }); }); diff --git a/src/generic_ui/polymer/root.html b/src/generic_ui/polymer/root.html index 3a9a9761bd..ba5e4158e5 100644 --- a/src/generic_ui/polymer/root.html +++ b/src/generic_ui/polymer/root.html @@ -380,7 +380,7 @@

{{ "WELCOME" | $$ }}

{{ "DISCONNECTED_TITLE" | $$ }}

-

{{ 'RECONNECTING' | $$ }}

+ {{ 'RECONNECTING' | $$ }}
diff --git a/src/generic_ui/polymer/root.ts b/src/generic_ui/polymer/root.ts index e894be1b44..5a52261c4f 100644 --- a/src/generic_ui/polymer/root.ts +++ b/src/generic_ui/polymer/root.ts @@ -168,7 +168,6 @@ Polymer({ }, revertProxySettings: function() { this.ui.stopUsingProxy(); - this.ui.stopGettingInUiAndConfig({instanceId: null, error: false}); }, restartProxying: function() { this.ui.restartProxying(); diff --git a/src/generic_ui/scripts/ui.spec.ts b/src/generic_ui/scripts/ui.spec.ts index 64dc8b58ab..590dbce6bf 100644 --- a/src/generic_ui/scripts/ui.spec.ts +++ b/src/generic_ui/scripts/ui.spec.ts @@ -22,7 +22,15 @@ describe('UI.UserInterface', () => { // Create a fresh UI object before each test. mockCore = jasmine.createSpyObj( 'core', - ['reset', 'onUpdate', 'sendCommand', 'on', 'connect', 'getFullState']); + [ + 'reset', + 'onUpdate', + 'sendCommand', + 'on', + 'connect', + 'getFullState', + 'stop' + ]); // assume connect always resolves immediately (mockCore.connect).and.returnValue(Promise.resolve()); @@ -248,7 +256,7 @@ describe('UI.UserInterface', () => { 'testInstanceId', { address : 'testAddress' , port : 0 }); expect(mockBrowserApi.setIcon) .toHaveBeenCalledWith(Constants.GETTING_ICON); - ui.stopGettingInUiAndConfig({instanceId: null, error: false}); + ui.stoppedGetting({instanceId: null, error: false}); }); it('Extension icon changes when you stop getting access', () => { diff --git a/src/generic_ui/scripts/ui.ts b/src/generic_ui/scripts/ui.ts index 76b4eb1eb3..5379f74e15 100644 --- a/src/generic_ui/scripts/ui.ts +++ b/src/generic_ui/scripts/ui.ts @@ -246,7 +246,7 @@ export class UserInterface implements ui_constants.UiApi { this.view = ui_constants.View.BROWSER_ERROR; if (this.isGettingAccess()) { - this.stopGettingInUiAndConfig({instanceId: null, error: true}); + this.stoppedGetting({instanceId: null, error: true}); } }); @@ -283,7 +283,7 @@ export class UserInterface implements ui_constants.UiApi { // indicates the current getting connection has ended core.onUpdate(uproxy_core_api.Update.STOP_GETTING, (error :boolean) => { - this.stopGettingInUiAndConfig({instanceId: null, error: error}); + this.stoppedGetting({instanceId: null, error: error}); }); // indicates we just started offering access through copy+paste @@ -308,7 +308,7 @@ export class UserInterface implements ui_constants.UiApi { core.onUpdate(uproxy_core_api.Update.STOP_GETTING_FROM_FRIEND, (data :social.StopProxyInfo) => { // TODO better type - this.stopGettingInUiAndConfig(data); + this.stoppedGetting(data); }); core.onUpdate(uproxy_core_api.Update.START_GIVING_TO_FRIEND, @@ -370,6 +370,9 @@ export class UserInterface implements ui_constants.UiApi { console.error('proxying attempt ' + info.proxyingId + ' failed (getting)'); if (!this.proxySet_) { + // This is an immediate failure, i.e. failure of a connection attempt + // that never connected. It is not a retry. + // Show the error toast indicating that a get attempt failed. this.toastMessage = this.i18n_t("UNABLE_TO_GET_FROM", { name: info.name }); @@ -575,18 +578,15 @@ export class UserInterface implements ui_constants.UiApi { } /** - * Removes proxy indicators from UI and undoes proxy configuration - * (e.g. chrome.proxy settings). + * Takes all actions required when getting stops, including removing proxy + * indicators from the UI, and retrying the connection if appropriate. * If user didn't end proxying, so if proxy session ended because of some * unexpected reason, user should be asked before reverting proxy settings. * if data.instanceId is null, it means to stop active proxying. */ - public stopGettingInUiAndConfig = (data :social.StopProxyInfo) => { + public stoppedGetting = (data :social.StopProxyInfo) => { if (data.instanceId) { this.mapInstanceIdToUser_[data.instanceId].isSharingWithMe = false; - - // Possibly redundant. - this.core.stop(this.getInstancePath_(this.instanceGettingAccessFrom_)); } else if (this.instanceGettingAccessFrom_) { this.mapInstanceIdToUser_[this.instanceGettingAccessFrom_].isSharingWithMe = false; } @@ -602,7 +602,6 @@ export class UserInterface implements ui_constants.UiApi { if (data.instanceId === null || data.instanceId === this.instanceGettingAccessFrom_) { this.instanceGettingAccessFrom_ = null; - this.core.disconnectedWhileProxying = false; } } @@ -610,9 +609,21 @@ export class UserInterface implements ui_constants.UiApi { this.updateIcon_(); } + /** + * Undoes proxy configuration (e.g. chrome.proxy settings). + */ public stopUsingProxy = () => { this.browserApi.stopUsingProxy(); this.proxySet_ = false; + this.core.disconnectedWhileProxying = false; + this.updateIcon_(); + + // revertProxySettings might call stopUsingProxy while a reconnection is + // still being attempted. In that case, we also want to terminate the + // in-progress connection. + if (this.instanceTryingToGetAccessFrom) { + this.stopGettingFromInstance(this.instanceTryingToGetAccessFrom); + } } private getInstancePath_ = (instanceId :string) => { @@ -767,7 +778,7 @@ export class UserInterface implements ui_constants.UiApi { this.reconnect(networkMsg.name); } else { if (this.instanceGettingAccessFrom_) { - this.stopGettingInUiAndConfig({instanceId: null, error: true}); + this.stopGettingFromInstance(this.instanceGettingAccessFrom_); } this.showNotification(this.i18n_t("LOGGED_OUT", {network: networkMsg.name})); From 4500315b34d8f1eb648ba8c49a5defba45d9d83c Mon Sep 17 00:00:00 2001 From: Ben Schwartz Date: Mon, 24 Aug 2015 15:49:06 -0400 Subject: [PATCH 4/4] Move state about proxy-to-reconnect to the core --- src/generic_ui/polymer/root.html | 2 +- src/generic_ui/scripts/core_connector.ts | 4 ++- src/generic_ui/scripts/ui.ts | 46 +++++++++++------------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/generic_ui/polymer/root.html b/src/generic_ui/polymer/root.html index ba5e4158e5..de83603beb 100644 --- a/src/generic_ui/polymer/root.html +++ b/src/generic_ui/polymer/root.html @@ -374,7 +374,7 @@

{{ "WELCOME" | $$ }}

+ opened="{{ !!core.disconnectedWhileProxying }}" autoCloseDisabled>

{{ "DISCONNECTED_TITLE" | $$ }}

diff --git a/src/generic_ui/scripts/core_connector.ts b/src/generic_ui/scripts/core_connector.ts index 0ad7ffaf23..68ff95541a 100644 --- a/src/generic_ui/scripts/core_connector.ts +++ b/src/generic_ui/scripts/core_connector.ts @@ -30,7 +30,9 @@ class CoreConnector implements uproxy_core_api.CoreApi { private mapPromiseIdToFulfillAndReject_ :{[id :number] : FullfillAndReject} = {}; - public disconnectedWhileProxying = false; + // If non-null, the ID of the instance from which we are presently + // disconnected. + public disconnectedWhileProxying :string = null; constructor(private browserConnector_ :browser_connector.CoreBrowserConnector) { this.browserConnector_.onUpdate(uproxy_core_api.Update.COMMAND_FULFILLED, diff --git a/src/generic_ui/scripts/ui.ts b/src/generic_ui/scripts/ui.ts index 5379f74e15..6dff8dc5c0 100644 --- a/src/generic_ui/scripts/ui.ts +++ b/src/generic_ui/scripts/ui.ts @@ -191,9 +191,6 @@ export class UserInterface implements ui_constants.UiApi { // ID of the most recent failed proxying attempt. public proxyingId: string; - // is a proxy currently set - private proxySet_ :boolean = false; - // Must be included in Chrome extension manifest's list of permissions. public AWS_FRONT_DOMAIN = 'https://a0.awsstatic.com/'; @@ -369,7 +366,7 @@ export class UserInterface implements ui_constants.UiApi { (info:uproxy_core_api.FailedToGetOrGive) => { console.error('proxying attempt ' + info.proxyingId + ' failed (getting)'); - if (!this.proxySet_) { + if (!this.core.disconnectedWhileProxying) { // This is an immediate failure, i.e. failure of a connection attempt // that never connected. It is not a retry. // Show the error toast indicating that a get attempt failed. @@ -585,24 +582,20 @@ export class UserInterface implements ui_constants.UiApi { * if data.instanceId is null, it means to stop active proxying. */ public stoppedGetting = (data :social.StopProxyInfo) => { - if (data.instanceId) { - this.mapInstanceIdToUser_[data.instanceId].isSharingWithMe = false; - } else if (this.instanceGettingAccessFrom_) { - this.mapInstanceIdToUser_[this.instanceGettingAccessFrom_].isSharingWithMe = false; + var instanceId = data.instanceId || this.instanceGettingAccessFrom_; + + if (instanceId === this.instanceGettingAccessFrom_) { + this.instanceGettingAccessFrom_ = null; } - if (data.error) { - this.bringUproxyToFront(); - this.core.disconnectedWhileProxying = true; - if (this.instanceGettingAccessFrom_) { + if (instanceId) { + this.mapInstanceIdToUser_[instanceId].isSharingWithMe = false; + if (data.error) { + this.bringUproxyToFront(); + this.core.disconnectedWhileProxying = instanceId; // Auto-retry. this.restartProxying(); } - } else if (!this.proxySet_) { - if (data.instanceId === null || - data.instanceId === this.instanceGettingAccessFrom_) { - this.instanceGettingAccessFrom_ = null; - } } this.updateGettingStatusBar_(); @@ -614,8 +607,7 @@ export class UserInterface implements ui_constants.UiApi { */ public stopUsingProxy = () => { this.browserApi.stopUsingProxy(); - this.proxySet_ = false; - this.core.disconnectedWhileProxying = false; + this.core.disconnectedWhileProxying = null; this.updateIcon_(); // revertProxySettings might call stopUsingProxy while a reconnection is @@ -640,7 +632,7 @@ export class UserInterface implements ui_constants.UiApi { } public restartProxying = () => { - this.startGettingFromInstance(this.instanceGettingAccessFrom_); + this.startGettingFromInstance(this.core.disconnectedWhileProxying); } public startGettingFromInstance = (instanceId :string) :Promise => { @@ -691,14 +683,13 @@ export class UserInterface implements ui_constants.UiApi { this.mapInstanceIdToUser_[instanceId].isSharingWithMe = true; } - this.core.disconnectedWhileProxying = false; + this.core.disconnectedWhileProxying = null; this.startGettingInUi(); this.updateGettingStatusBar_(); this.browserApi.startUsingProxy(endpoint); - this.proxySet_ = true; } /** @@ -841,12 +832,17 @@ export class UserInterface implements ui_constants.UiApi { } for (var i = 0; i < payload.offeringInstances.length; i++) { - if (payload.offeringInstances[i].localGettingFromRemote === - social.GettingState.GETTING_ACCESS) { - this.instanceGettingAccessFrom_ = payload.offeringInstances[i].instanceId; + var gettingState = payload.offeringInstances[i].localGettingFromRemote; + var instanceId = payload.offeringInstances[i].instanceId; + if (gettingState === social.GettingState.GETTING_ACCESS) { + this.instanceGettingAccessFrom_ = instanceId; user.isSharingWithMe = true; this.updateGettingStatusBar_(); break; + } else if (gettingState === social.GettingState.TRYING_TO_GET_ACCESS) { + this. instanceTryingToGetAccessFrom = instanceId; + this.updateGettingStatusBar_(); + break; } }