From 4c439c56f4167419b224ab7d07cd4d4264d30869 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Tue, 17 Sep 2024 10:21:26 +0200 Subject: [PATCH 1/5] fix(ParticipantsStore): remove unnecessary event listeners and timeout. It's only received when using internal server. Replace them with events from the base class so we make sure it's always received. Also, add a new event for failed joining Signed-off-by: DorraJaouad --- src/store/participantsStore.js | 27 +++++++++++++-------------- src/utils/signaling.js | 3 ++- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/store/participantsStore.js b/src/store/participantsStore.js index 6f2b55655bc..b2203523386 100644 --- a/src/store/participantsStore.js +++ b/src/store/participantsStore.js @@ -789,10 +789,19 @@ const actions = { return } - commit('setInCall', { - token, - sessionId: participantIdentifier.sessionId, - flags, + // Preparing the event listener for the signaling-join-call event + EventBus.once('signaling-join-call', () => { + commit('setInCall', { + token, + sessionId: participantIdentifier.sessionId, + flags, + }) + commit('finishedConnecting', { token, sessionId: participantIdentifier.sessionId }) + }) + + // Preparing the event listener for the signaling-join-call-failed event + EventBus.once('signaling-join-call-failed', () => { + commit('finishedConnecting', { token, sessionId: participantIdentifier.sessionId }) }) const actualFlags = await joinCall(token, flags, silent, recordingConsent) @@ -801,16 +810,6 @@ const actions = { inCall: actualFlags, } commit('updateParticipant', { token, attendeeId: attendee.attendeeId, updatedData }) - - EventBus.once('signaling-users-in-room', () => { - commit('finishedConnecting', { token, sessionId: participantIdentifier.sessionId }) - }) - - setTimeout(() => { - // If by accident we never receive a users list, just switch to - // "Waiting for others to join the call …" after some seconds. - commit('finishedConnecting', { token, sessionId: participantIdentifier.sessionId }) - }, 10000) }, async leaveCall({ commit, getters }, { token, participantIdentifier, all = false }) { diff --git a/src/utils/signaling.js b/src/utils/signaling.js index ee3ce49b6ea..83d831a38d2 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -281,11 +281,12 @@ Signaling.Base.prototype.joinCall = function(token, flags, silent, recordingCons .catch(function(e) { reject(new Error()) console.error('Connection failed, reason: ', e) + this._trigger('joinCallFailed', [token]) store.commit('connectionFailed', { token, payload: e.response?.data?.ocs, }) - }) + }.bind(this)) }) } From 2d9743f74e582cba25f226dfc6bd480d415e1822 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Tue, 17 Sep 2024 10:22:39 +0200 Subject: [PATCH 2/5] Fix(ParticipantsStore): separate joining states from each others (isInCall, connecting, connection failed) Signed-off-by: DorraJaouad --- src/store/participantsStore.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/store/participantsStore.js b/src/store/participantsStore.js index b2203523386..09c5c45f546 100644 --- a/src/store/participantsStore.js +++ b/src/store/participantsStore.js @@ -321,20 +321,11 @@ const mutations = { if (state.inCall[token] && state.inCall[token][sessionId]) { Vue.delete(state.inCall[token], sessionId) } - - if (state.connecting[token] && state.connecting[token][sessionId]) { - Vue.delete(state.connecting[token], sessionId) - } } else { if (!state.inCall[token]) { Vue.set(state.inCall, token, {}) } Vue.set(state.inCall[token], sessionId, flags) - - if (!state.connecting[token]) { - Vue.set(state.connecting, token, {}) - } - Vue.set(state.connecting[token], sessionId, flags) } }, @@ -342,6 +333,17 @@ const mutations = { Vue.set(state.connectionFailed, token, payload) }, + clearConnectionFailed(state, token) { + Vue.delete(state.connectionFailed, token) + }, + + connecting(state, { token, sessionId, flags }) { + if (!state.connecting[token]) { + Vue.set(state.connecting, token, {}) + } + Vue.set(state.connecting[token], sessionId, flags) + }, + finishedConnecting(state, { token, sessionId }) { if (state.connecting[token] && state.connecting[token][sessionId]) { Vue.delete(state.connecting[token], sessionId) @@ -778,6 +780,8 @@ const actions = { }, async joinCall({ commit, getters }, { token, participantIdentifier, flags, silent, recordingConsent }) { + commit('connecting', { token, sessionId: participantIdentifier.sessionId, flags }) + if (!participantIdentifier?.sessionId) { console.error('Trying to join call without sessionId') return @@ -1128,6 +1132,10 @@ const actions = { setPhoneMute(context, { callid, value }) { context.commit('setPhoneMute', { callid, value }) }, + + clearConnectionFailed(context, token) { + context.commit('clearConnectionFailed', token) + } } export default { state, mutations, getters, actions } From 50db6113e3f83342a2b84ed22f2abea650a965ed Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Tue, 17 Sep 2024 10:23:50 +0200 Subject: [PATCH 3/5] feat(Call): Stop switching to CallView without a successful join. Introduce a failed join message dialog. Signed-off-by: DorraJaouad --- src/components/CallView/CallFailedDialog.vue | 72 +++++++++++++++++++ .../CallView/shared/EmptyCallView.vue | 54 +------------- src/components/TopBar/CallButton.vue | 24 ++++++- 3 files changed, 95 insertions(+), 55 deletions(-) create mode 100644 src/components/CallView/CallFailedDialog.vue diff --git a/src/components/CallView/CallFailedDialog.vue b/src/components/CallView/CallFailedDialog.vue new file mode 100644 index 00000000000..238d8df25ed --- /dev/null +++ b/src/components/CallView/CallFailedDialog.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/components/CallView/shared/EmptyCallView.vue b/src/components/CallView/shared/EmptyCallView.vue index 7fc355063d7..6e649677f1e 100644 --- a/src/components/CallView/shared/EmptyCallView.vue +++ b/src/components/CallView/shared/EmptyCallView.vue @@ -16,9 +16,6 @@

{{ message }}

-

- {{ helper }} -

@@ -30,25 +27,16 @@