From de0d69a20e2efa2492add4bca5dc47369a98fd54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 28 Nov 2017 15:03:38 +0100 Subject: [PATCH] feat(errors): fix error handling for connection and conference Properly handle errors while connecting or joining a conference. Prior to this patch, only errors on established conferences / connections were saved to the redux store. --- react/features/base/conference/reducer.js | 5 ++++- react/features/base/connection/reducer.js | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/react/features/base/conference/reducer.js b/react/features/base/conference/reducer.js index c7409bdbf..844c11ae8 100644 --- a/react/features/base/conference/reducer.js +++ b/react/features/base/conference/reducer.js @@ -82,7 +82,10 @@ ReducerRegistry.register('features/base/conference', (state = {}, action) => { * reduction of the specified action. */ function _conferenceFailed(state, { conference, error }) { - if (state.conference && state.conference !== conference) { + // The active conference or the one we are joining. + const conference_ = state.conference || state.joining; + + if (conference_ && conference_ !== conference) { return state; } diff --git a/react/features/base/connection/reducer.js b/react/features/base/connection/reducer.js index 0c2fbe06a..d7ec6d0b1 100644 --- a/react/features/base/connection/reducer.js +++ b/react/features/base/connection/reducer.js @@ -96,7 +96,11 @@ function _connectionFailed( connection: Object, error: Object | string }) { - if (state.connection && state.connection !== connection) { + + // The active or in-progress connection. + const connection_ = state.connecting || state.connection; + + if (connection_ && connection_ !== connection) { return state; }