From ed26b666bb3171b131978055b79eaa7cfb3c5711 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Mon, 25 Sep 2023 15:06:58 +0530 Subject: [PATCH] fix(meeting): fix intermittently leaving meeting before even joining - SPARK-379330 --- .circleci/config.yml | 5 +++-- src/MeetingsSDKAdapter.js | 13 +++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f716ee7e..2600a504 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,9 +59,10 @@ jobs: integration-test: executor: node-fermium-executor steps: - - browser-tools/install-chrome + - checkout_from_workspace # https://discuss.circleci.com/t/cannot-checkout-anymore/46671 + - browser-tools/install-chrome: + chrome-version: "114.0.5735.90" # https://github.com/CircleCI-Public/browser-tools-orb/issues/75 - browser-tools/install-chromedriver - - checkout_from_workspace - restore_cache: keys: - dependency-cache-{{ checksum "package-lock.json" }} diff --git a/src/MeetingsSDKAdapter.js b/src/MeetingsSDKAdapter.js index f2217104..da5dde99 100644 --- a/src/MeetingsSDKAdapter.js +++ b/src/MeetingsSDKAdapter.js @@ -111,12 +111,6 @@ const LAYOUT_TYPES_MAP = { Focus: 'Single', }; -const SDK_MEMBER_STATUS_TO_ADAPTER_MEETING_STATE = { - IN_LOBBY: MeetingState.LOBBY, - IN_MEETING: MeetingState.JOINED, - NOT_IN_MEETING: MeetingState.LEFT, -}; - const ON_IOS_15_1 = typeof navigator !== 'undefined' && navigator.userAgent.includes('iPhone OS 15_1'); @@ -1276,12 +1270,11 @@ export default class MeetingsSDKAdapter extends MeetingsAdapter { const meetingStateChange$ = fromEvent(sdkMeeting && sdkMeeting.members, EVENT_MEMBERS_UPDATE) .pipe( - map((event) => { + map(() => { logger.debug('MEETING', ID, 'getMeeting()', ['received', EVENT_MEMBERS_UPDATE, 'event']); - const self = Object.values(event.full).find((m) => m.isSelf); + const self = sdkMeeting.joinedWith; - return SDK_MEMBER_STATUS_TO_ADAPTER_MEETING_STATE[self && self.status] - || MeetingState.NOT_JOINED; + return (self && self.state) || MeetingState.NOT_JOINED; }), distinctUntilChanged(), tap((state) => {