From 6444ebf1099e09b5e1faaec83060e39c74de17e0 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 9 Jun 2022 12:35:52 -0600 Subject: [PATCH 1/4] Remove isChunked since no longer used --- src/libs/PusherUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/PusherUtils.js b/src/libs/PusherUtils.js index 60218697ae26..c3f451d7c99d 100644 --- a/src/libs/PusherUtils.js +++ b/src/libs/PusherUtils.js @@ -40,7 +40,7 @@ function subscribeToPrivateUserChannelEvent(eventName, accountID, onEvent, isChu function onSubscriptionFailed(error) { Log.hmmm('Failed to subscribe to Pusher channel', false, {error, pusherChannelName, eventName}); } - Pusher.subscribe(pusherChannelName, eventName, onEventPush, isChunked, onPusherResubscribeToPrivateUserChannel) + Pusher.subscribe(pusherChannelName, eventName, onEventPush, onPusherResubscribeToPrivateUserChannel) .catch(onSubscriptionFailed); } From 9c833d1220abbe63d481ff5d37b89e55a4476dbe Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 9 Jun 2022 12:39:04 -0600 Subject: [PATCH 2/4] Remove more instances where `isChunked` was passed --- src/libs/PusherUtils.js | 3 +-- src/libs/actions/Report.js | 2 -- src/libs/actions/User.js | 2 +- src/pages/settings/Security/SecuritySettingsPage.js | 11 +++++++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/libs/PusherUtils.js b/src/libs/PusherUtils.js index c3f451d7c99d..2cd614c604e5 100644 --- a/src/libs/PusherUtils.js +++ b/src/libs/PusherUtils.js @@ -10,9 +10,8 @@ import CONST from '../CONST'; * @param {String} eventName * @param {String} accountID * @param {Function} onEvent - * @param {Boolean} isChunked */ -function subscribeToPrivateUserChannelEvent(eventName, accountID, onEvent, isChunked = false) { +function subscribeToPrivateUserChannelEvent(eventName, accountID, onEvent) { const pusherChannelName = `${CONST.PUSHER.PRIVATE_USER_CHANNEL_PREFIX}${accountID}${CONFIG.PUSHER.SUFFIX}`; /** diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 8b513597817a..3abd3ba12356 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -618,7 +618,6 @@ function subscribeToUserEvents() { Pusher.TYPE.REPORT_COMMENT_CHUNK, currentUserAccountID, pushJSON => updateReportWithNewAction(pushJSON.reportID, pushJSON.reportAction, pushJSON.notificationPreference), - true, ); // Live-update a report's actions when an 'edit comment' event is received. @@ -631,7 +630,6 @@ function subscribeToUserEvents() { Pusher.TYPE.REPORT_COMMENT_EDIT_CHUNK, currentUserAccountID, pushJSON => updateReportActionMessage(pushJSON.reportID, pushJSON.sequenceNumber, pushJSON.message), - true, ); } diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index cc7b282f3029..777bd268b9f3 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -314,7 +314,7 @@ function subscribeToUserEvents() { SequentialQueue.getCurrentRequest().then(() => { Onyx.update(pushJSON.onyxData); }); - }, true); + }); // Live-update an user's preferred locale Pusher.subscribe(pusherChannelName, Pusher.TYPE.PREFERRED_LOCALE, (pushJSON) => { diff --git a/src/pages/settings/Security/SecuritySettingsPage.js b/src/pages/settings/Security/SecuritySettingsPage.js index 72e9df3cebfb..c59a5b0a54ce 100644 --- a/src/pages/settings/Security/SecuritySettingsPage.js +++ b/src/pages/settings/Security/SecuritySettingsPage.js @@ -9,6 +9,9 @@ import * as Expensicons from '../../../components/Icon/Expensicons'; import ScreenWrapper from '../../../components/ScreenWrapper'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; import MenuItem from '../../../components/MenuItem'; +import * as Pusher from '../../../libs/Pusher/pusher'; + +import Config from '../../../CONFIG'; const propTypes = { ...withLocalizePropTypes, @@ -58,6 +61,14 @@ const SecuritySettingsPage = (props) => { shouldShowRightIcon /> ))} + { + // console.log('here we trigger pusher'); + console.log('[MY SUFFIX]', Config.PUSHER.SUFFIX); + // Pusher.sendEvent('private-encrypted-report-reportID-7', 'client-userIsTyping', {payload: 'yes'}); + }} + /> From e64ba1516f8eb9cc1b6557bd9ad2ee201b96606e Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 9 Jun 2022 12:47:46 -0600 Subject: [PATCH 3/4] Remove local tested menu item --- src/pages/settings/Security/SecuritySettingsPage.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/pages/settings/Security/SecuritySettingsPage.js b/src/pages/settings/Security/SecuritySettingsPage.js index c59a5b0a54ce..b9b4e2b07921 100644 --- a/src/pages/settings/Security/SecuritySettingsPage.js +++ b/src/pages/settings/Security/SecuritySettingsPage.js @@ -9,7 +9,6 @@ import * as Expensicons from '../../../components/Icon/Expensicons'; import ScreenWrapper from '../../../components/ScreenWrapper'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; import MenuItem from '../../../components/MenuItem'; -import * as Pusher from '../../../libs/Pusher/pusher'; import Config from '../../../CONFIG'; @@ -61,14 +60,6 @@ const SecuritySettingsPage = (props) => { shouldShowRightIcon /> ))} - { - // console.log('here we trigger pusher'); - console.log('[MY SUFFIX]', Config.PUSHER.SUFFIX); - // Pusher.sendEvent('private-encrypted-report-reportID-7', 'client-userIsTyping', {payload: 'yes'}); - }} - /> From b04fa31aa0bf2a62126ed40204bdda778a0d9359 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 9 Jun 2022 12:48:24 -0600 Subject: [PATCH 4/4] Remove unused import --- src/pages/settings/Security/SecuritySettingsPage.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/settings/Security/SecuritySettingsPage.js b/src/pages/settings/Security/SecuritySettingsPage.js index b9b4e2b07921..72e9df3cebfb 100644 --- a/src/pages/settings/Security/SecuritySettingsPage.js +++ b/src/pages/settings/Security/SecuritySettingsPage.js @@ -10,8 +10,6 @@ import ScreenWrapper from '../../../components/ScreenWrapper'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; import MenuItem from '../../../components/MenuItem'; -import Config from '../../../CONFIG'; - const propTypes = { ...withLocalizePropTypes, };