From 129c762b7570b78eb07be759b09b5dbd7537d57a Mon Sep 17 00:00:00 2001 From: Matt Krick Date: Thu, 24 Aug 2017 12:37:24 -0700 Subject: [PATCH] fix #1299 bad rejoin facilitator logic --- src/server/graphql/models/Team/notifySlack/notifySlack.js | 6 +++++- .../containers/MeetingContainer/MeetingContainer.js | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/server/graphql/models/Team/notifySlack/notifySlack.js b/src/server/graphql/models/Team/notifySlack/notifySlack.js index 2f282dc23f8..7c53bd1e94c 100644 --- a/src/server/graphql/models/Team/notifySlack/notifySlack.js +++ b/src/server/graphql/models/Team/notifySlack/notifySlack.js @@ -16,7 +16,11 @@ const notifySlack = async (integrations, teamId, slackText) => { const provider = await r.table('Provider') .getAll(teamId, {index: 'teamId'}) .filter({service: SLACK, isActive: true}) - .nth(0); + .nth(0) + .default(null); + if (!provider) { + throw new Error('SlackIntegration exists without Provider! Something is fishy'); + } // for each slack channel, send a notification for (let i = 0; i < integrations.length; i++) { const integration = integrations[i]; diff --git a/src/universal/modules/meeting/containers/MeetingContainer/MeetingContainer.js b/src/universal/modules/meeting/containers/MeetingContainer/MeetingContainer.js index 05674c88c46..1535e1395e0 100644 --- a/src/universal/modules/meeting/containers/MeetingContainer/MeetingContainer.js +++ b/src/universal/modules/meeting/containers/MeetingContainer/MeetingContainer.js @@ -328,9 +328,10 @@ export default class MeetingContainer extends Component { || ((localPhase === CHECKIN || localPhase === UPDATES) && members.length < localPhaseItem)) { return ; } - const phasesAlwaysInSync = ['lobby', 'firstcall', 'lastcall']; - const inSync = isFacilitating || phasesAlwaysInSync.includes(meetingPhase) ? true : - localPhase + localPhaseItem === facilitatorPhase + facilitatorPhaseItem; + + const inSync = isFacilitating || facilitatorPhase === localPhase && + // FIXME remove || when changing to relay. right now it's a null & an undefined + (facilitatorPhaseItem === localPhaseItem || !facilitatorPhaseItem && !localPhaseItem); const rejoinFacilitator = () => { const pushURL = makePushURL(teamId, facilitatorPhase, facilitatorPhaseItem); history.push(pushURL);