From 3748678680fa37a4388f307168c01e1675e11b69 Mon Sep 17 00:00:00 2001 From: daraksha Date: Mon, 16 Jan 2023 22:26:26 +0530 Subject: [PATCH 01/28] Set lineHeight for html rendered message --- src/styles/styles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/styles.js b/src/styles/styles.js index 71fed02015b4..aa7ee4ff184d 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -141,6 +141,7 @@ const webViewStyles = { fontSize: variables.fontSizeNormal, fontFamily: fontFamily.EXP_NEUE, flex: 1, + lineHeight: variables.fontSizeNormalHeight, }, }; From b19c9b8c7f968b88b041dfc3e1b4b474ca8e54b9 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Thu, 19 Jan 2023 18:50:59 +0000 Subject: [PATCH 02/28] fix: package.json & package-lock.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-ELECTRON-3237489 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c465a13af61..8afa72c00f26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -133,7 +133,7 @@ "css-loader": "^5.2.4", "diff-so-fancy": "^1.3.0", "dotenv": "^16.0.3", - "electron": "^21.3.4", + "electron": "^21.3.5", "electron-builder": "23.5.0", "electron-notarize": "^1.2.1", "eslint": "^7.6.0", @@ -21553,9 +21553,9 @@ } }, "node_modules/electron": { - "version": "21.3.4", - "resolved": "https://registry.npmjs.org/electron/-/electron-21.3.4.tgz", - "integrity": "sha512-700+zY0j7DikPtBRxb68i24HGGcJKqyJ9MrJoHc0J1pwcJLJFoDBP7lj2CK7QmHTO95D0d30jnvQQwreKhyozA==", + "version": "21.3.5", + "resolved": "https://registry.npmjs.org/electron/-/electron-21.3.5.tgz", + "integrity": "sha512-KV/qACdMsppgrleKuPNKk2kynO/o+hCDbl6MfGFbqY3d8RnhLixCBuertBrcap04dQ5vspMiDHekMOpSDS3SaA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -59205,9 +59205,9 @@ } }, "electron": { - "version": "21.3.4", - "resolved": "https://registry.npmjs.org/electron/-/electron-21.3.4.tgz", - "integrity": "sha512-700+zY0j7DikPtBRxb68i24HGGcJKqyJ9MrJoHc0J1pwcJLJFoDBP7lj2CK7QmHTO95D0d30jnvQQwreKhyozA==", + "version": "21.3.5", + "resolved": "https://registry.npmjs.org/electron/-/electron-21.3.5.tgz", + "integrity": "sha512-KV/qACdMsppgrleKuPNKk2kynO/o+hCDbl6MfGFbqY3d8RnhLixCBuertBrcap04dQ5vspMiDHekMOpSDS3SaA==", "dev": true, "requires": { "@electron/get": "^1.14.1", diff --git a/package.json b/package.json index e3fa7eb5eded..b3df9fff4d28 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ "css-loader": "^5.2.4", "diff-so-fancy": "^1.3.0", "dotenv": "^16.0.3", - "electron": "^21.3.4", + "electron": "^21.3.5", "electron-builder": "23.5.0", "electron-notarize": "^1.2.1", "eslint": "^7.6.0", From adcb010372e431f59dc6190e62e0f3b981d0dc9d Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 19 Jan 2023 14:11:42 -0700 Subject: [PATCH 03/28] use ascii keyboard --- src/components/RoomNameInput/index.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/RoomNameInput/index.native.js b/src/components/RoomNameInput/index.native.js index 273bae8a8107..9aabf5b79b7c 100644 --- a/src/components/RoomNameInput/index.native.js +++ b/src/components/RoomNameInput/index.native.js @@ -30,7 +30,7 @@ class RoomNameInput extends Component { } render() { - const keyboardType = getOperatingSystem() === CONST.OS.IOS ? 'default' : 'visible-password'; + const keyboardType = getOperatingSystem() === CONST.OS.IOS ? 'ascii-capable' : 'visible-password'; return ( Date: Thu, 19 Jan 2023 14:12:47 -0700 Subject: [PATCH 04/28] use consts --- src/CONST.js | 1 + src/components/RoomNameInput/index.native.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CONST.js b/src/CONST.js index 562ab73ef6e0..fc969800afae 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -482,6 +482,7 @@ const CONST = { DECIMAL_PAD: 'decimal-pad', VISIBLE_PASSWORD: 'visible-password', EMAIL_ADDRESS: 'email-address', + ASCII_CAPABLE: 'ascii-capable', }, ATTACHMENT_SOURCE_ATTRIBUTE: 'data-expensify-source', diff --git a/src/components/RoomNameInput/index.native.js b/src/components/RoomNameInput/index.native.js index 9aabf5b79b7c..4b3cd5cc8331 100644 --- a/src/components/RoomNameInput/index.native.js +++ b/src/components/RoomNameInput/index.native.js @@ -30,7 +30,7 @@ class RoomNameInput extends Component { } render() { - const keyboardType = getOperatingSystem() === CONST.OS.IOS ? 'ascii-capable' : 'visible-password'; + const keyboardType = getOperatingSystem() === CONST.OS.IOS ? CONST.KEYBOARD_TYPE.ASCII_CAPABLE : CONST.KEYBOARD_TYPE.VISIBLE_PASSWORD; return ( Date: Thu, 19 Jan 2023 14:16:17 -0700 Subject: [PATCH 05/28] do not autocapitalize --- src/components/RoomNameInput/index.native.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/RoomNameInput/index.native.js b/src/components/RoomNameInput/index.native.js index 4b3cd5cc8331..a2af6fbbf049 100644 --- a/src/components/RoomNameInput/index.native.js +++ b/src/components/RoomNameInput/index.native.js @@ -45,6 +45,7 @@ class RoomNameInput extends Component { keyboardType={keyboardType} // this is a bit hacky solution to a RN issue https://github.com/facebook/react-native/issues/27449 onBlur={this.props.onBlur} autoFocus={this.props.autoFocus} + autoCapitalize="none" /> ); } From 6e354b8b4492cf9c18052dcf525f4ae5e88f585c Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 19 Jan 2023 14:32:07 -0700 Subject: [PATCH 06/28] replace smart dash with -- --- src/libs/RoomNameInputUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/RoomNameInputUtils.js b/src/libs/RoomNameInputUtils.js index 3940996ec3fa..1bc54dad52e5 100644 --- a/src/libs/RoomNameInputUtils.js +++ b/src/libs/RoomNameInputUtils.js @@ -8,7 +8,8 @@ import CONST from '../CONST'; */ function modifyRoomName(roomName) { const modifiedRoomNameWithoutHash = roomName - .replace(/ /g, '-'); + .replace(/ /g, '-') + .replace(/—/g, '--'); return `${CONST.POLICY.ROOM_PREFIX}${modifiedRoomNameWithoutHash}`; } From d2ed43511dfa17717c93c0efdc70daae522db1ac Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 19 Jan 2023 14:33:19 -0700 Subject: [PATCH 07/28] add comment --- src/libs/RoomNameInputUtils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/RoomNameInputUtils.js b/src/libs/RoomNameInputUtils.js index 1bc54dad52e5..15b85f9f651a 100644 --- a/src/libs/RoomNameInputUtils.js +++ b/src/libs/RoomNameInputUtils.js @@ -9,6 +9,8 @@ import CONST from '../CONST'; function modifyRoomName(roomName) { const modifiedRoomNameWithoutHash = roomName .replace(/ /g, '-') + + // Replaces the smart dash on iOS devices with two hyphens .replace(/—/g, '--'); return `${CONST.POLICY.ROOM_PREFIX}${modifiedRoomNameWithoutHash}`; From 1236e728de24cc17bb0f16428887e192c6942201 Mon Sep 17 00:00:00 2001 From: christianwenifr Date: Fri, 13 Jan 2023 11:17:04 +0700 Subject: [PATCH 08/28] feat: 14131 --- .../AppNavigator/MainDrawerNavigator.js | 47 +++++++++++-------- .../PopoverReportActionContextMenu.js | 27 +++++------ .../ContextMenu/ReportActionContextMenu.js | 6 +++ src/pages/home/report/ReportActionItem.js | 2 + src/pages/home/report/ReportActionsView.js | 7 --- src/pages/settings/AppDownloadLinks.js | 4 -- 6 files changed, 47 insertions(+), 46 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js b/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js index ecc67769e8b8..dfb67d739250 100644 --- a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js +++ b/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js @@ -14,6 +14,8 @@ import SidebarScreen from '../../../pages/home/sidebar/SidebarScreen'; import BaseDrawerNavigator from './BaseDrawerNavigator'; import * as ReportUtils from '../../ReportUtils'; import reportPropTypes from '../../../pages/reportPropTypes'; +import * as ReportActionContextMenu from '../../../pages/home/report/ContextMenu/ReportActionContextMenu'; +import PopoverReportActionContextMenu from '../../../pages/home/report/ContextMenu/PopoverReportActionContextMenu'; const propTypes = { /** Available reports that would be displayed in this navigator */ @@ -80,26 +82,31 @@ class MainDrawerNavigator extends Component { // This way routing information is updated (if needed) based on the initial report ID resolved. // This is usually needed after login/create account and re-launches return ( - { - // This state belongs to the drawer so it should always have the ReportScreen as it's initial (and only) route - const reportIDFromRoute = lodashGet(state, ['routes', 0, 'params', 'reportID']); - return ( - - ); - }} - screens={[ - { - name: SCREENS.REPORT, - component: ReportScreen, - initialParams: this.initialParams, - }, - ]} - isMainScreen - /> + <> + + { + // This state belongs to the drawer so it should always have the ReportScreen as it's initial (and only) route + const reportIDFromRoute = lodashGet(state, ['routes', 0, 'params', 'reportID']); + return ( + + ); + }} + screens={[ + { + name: SCREENS.REPORT, + component: ReportScreen, + initialParams: this.initialParams, + }, + ]} + isMainScreen + /> + ); } } diff --git a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js index 2f174ce5ccf2..770844edc342 100644 --- a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js +++ b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js @@ -3,7 +3,6 @@ import { Dimensions, } from 'react-native'; import _ from 'underscore'; -import PropTypes from 'prop-types'; import lodashGet from 'lodash/get'; import * as Report from '../../../../libs/actions/Report'; import withLocalize, {withLocalizePropTypes} from '../../../../components/withLocalize'; @@ -12,20 +11,9 @@ import BaseReportActionContextMenu from './BaseReportActionContextMenu'; import ConfirmModal from '../../../../components/ConfirmModal'; const propTypes = { - /** Flag to check if the chat participant is Chronos */ - isChronosReport: PropTypes.bool, - - /** Whether the provided report is an archived room */ - isArchivedRoom: PropTypes.bool, - ...withLocalizePropTypes, }; -const defaultProps = { - isChronosReport: false, - isArchivedRoom: false, -}; - class PopoverReportActionContextMenu extends React.Component { constructor(props) { super(props); @@ -48,6 +36,8 @@ class PopoverReportActionContextMenu extends React.Component { horizontal: 0, vertical: 0, }, + isArchivedRoom: false, + isChronosReport: false, }; this.onPopoverShow = () => {}; this.onPopoverHide = () => {}; @@ -126,6 +116,8 @@ class PopoverReportActionContextMenu extends React.Component { * @param {String} draftMessage - ReportAction Draftmessage * @param {Function} [onShow] - Run a callback when Menu is shown * @param {Function} [onHide] - Run a callback when Menu is hidden + * @param {Boolean} isArchivedRoom - isArchivedRoom + * @param {Boolean} isChronosReport - isChronosReport */ showContextMenu( type, @@ -137,6 +129,8 @@ class PopoverReportActionContextMenu extends React.Component { draftMessage, onShow = () => {}, onHide = () => {}, + isArchivedRoom, + isChronosReport, ) { const nativeEvent = event.nativeEvent || {}; this.contextMenuAnchor = contextMenuAnchor; @@ -167,6 +161,8 @@ class PopoverReportActionContextMenu extends React.Component { selection, isPopoverVisible: true, reportActionDraftMessage: draftMessage, + isArchivedRoom, + isChronosReport, }); }); } @@ -239,8 +235,8 @@ class PopoverReportActionContextMenu extends React.Component { selection={this.state.selection} reportID={this.state.reportID} reportAction={this.state.reportAction} - isArchivedRoom={this.props.isArchivedRoom} - isChronosReport={this.props.isChronosReport} + isArchivedRoom={this.state.isArchivedRoom} + isChronosReport={this.state.isChronosReport} anchor={this.contextMenuTargetNode} /> ); @@ -269,6 +265,8 @@ class PopoverReportActionContextMenu extends React.Component { reportAction: {}, isDeleteCommentConfirmModalVisible: false, shouldSetModalVisibilityForDeleteConfirmation: true, + isArchivedRoom: false, + isChronosReport: false, }); } @@ -336,6 +334,5 @@ class PopoverReportActionContextMenu extends React.Component { } PopoverReportActionContextMenu.propTypes = propTypes; -PopoverReportActionContextMenu.defaultProps = defaultProps; export default withLocalize(PopoverReportActionContextMenu); diff --git a/src/pages/home/report/ContextMenu/ReportActionContextMenu.js b/src/pages/home/report/ContextMenu/ReportActionContextMenu.js index 6d14773a8ff0..6acb7d5c33aa 100644 --- a/src/pages/home/report/ContextMenu/ReportActionContextMenu.js +++ b/src/pages/home/report/ContextMenu/ReportActionContextMenu.js @@ -14,6 +14,8 @@ const contextMenuRef = React.createRef(); * @param {String} draftMessage - ReportAction Draftmessage * @param {Function} [onShow=() => {}] - Run a callback when Menu is shown * @param {Function} [onHide=() => {}] - Run a callback when Menu is hidden + * @param {Boolean} isArchivedRoom - isArchivedRoom + * @param {Boolean} isChronosReport - isChronosReport */ function showContextMenu( type, @@ -25,6 +27,8 @@ function showContextMenu( draftMessage = '', onShow = () => {}, onHide = () => {}, + isArchivedRoom = false, + isChronosReport = false, ) { if (!contextMenuRef.current) { return; @@ -39,6 +43,8 @@ function showContextMenu( draftMessage, onShow, onHide, + isArchivedRoom, + isChronosReport, ); } diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index fe0b8049050e..f4a871078ed8 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -133,6 +133,8 @@ class ReportActionItem extends Component { this.props.draftMessage, undefined, this.checkIfContextMenuActive, + ReportUtils.isArchivedRoom(this.props.report), + ReportUtils.chatIncludesChronos(this.props.report), ); } diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 25aba06a5f78..5f035c807dde 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -12,8 +12,6 @@ import withWindowDimensions, {windowDimensionsPropTypes} from '../../../componen import {withDrawerPropTypes} from '../../../components/withDrawerState'; import * as ReportScrollManager from '../../../libs/ReportScrollManager'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; -import * as ReportActionContextMenu from './ContextMenu/ReportActionContextMenu'; -import PopoverReportActionContextMenu from './ContextMenu/PopoverReportActionContextMenu'; import Performance from '../../../libs/Performance'; import {withNetwork} from '../../../components/OnyxProvider'; import * as EmojiPickerAction from '../../../libs/actions/EmojiPickerAction'; @@ -371,11 +369,6 @@ class ReportActionsView extends React.Component { loadMoreChats={this.loadMoreChats} newMarkerReportActionID={this.state.newMarkerReportActionID} /> - )} diff --git a/src/pages/settings/AppDownloadLinks.js b/src/pages/settings/AppDownloadLinks.js index 2738d184419b..9b47bdb644ef 100644 --- a/src/pages/settings/AppDownloadLinks.js +++ b/src/pages/settings/AppDownloadLinks.js @@ -17,7 +17,6 @@ import withWindowDimensions, {windowDimensionsPropTypes} from '../../components/ import * as DeviceCapabilities from '../../libs/DeviceCapabilities'; import * as ReportActionContextMenu from '../home/report/ContextMenu/ReportActionContextMenu'; import * as ContextMenuActions from '../home/report/ContextMenu/ContextMenuActions'; -import PopoverReportActionContextMenu from '../home/report/ContextMenu/PopoverReportActionContextMenu'; const propTypes = { ...withLocalizePropTypes, @@ -81,9 +80,6 @@ const AppDownloadLinksPage = (props) => { onCloseButtonPress={() => Navigation.dismissModal(true)} /> - {_.map(menuItems, item => ( Date: Tue, 17 Jan 2023 12:29:07 +0700 Subject: [PATCH 09/28] fix: comment --- src/Expensify.js | 5 ++ .../AppNavigator/MainDrawerNavigator.js | 47 ++++++++----------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/Expensify.js b/src/Expensify.js index 71f0a7c80688..6750c365c164 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -24,6 +24,8 @@ import * as User from './libs/actions/User'; import NetworkConnection from './libs/NetworkConnection'; import Navigation from './libs/Navigation/Navigation'; import DeeplinkWrapper from './components/DeeplinkWrapper'; +import PopoverReportActionContextMenu from './pages/home/report/ContextMenu/PopoverReportActionContextMenu'; +import * as ReportActionContextMenu from './pages/home/report/ContextMenu/ReportActionContextMenu'; // This lib needs to be imported, but it has nothing to export since all it contains is an Onyx connection // eslint-disable-next-line no-unused-vars @@ -189,6 +191,9 @@ class Expensify extends PureComponent { {!this.state.isSplashShown && ( <> + {/* We include the modal for showing a new update at the top level so the option is always present. */} {this.props.updateAvailable ? : null} {this.props.screenShareRequest ? ( diff --git a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js b/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js index dfb67d739250..ecc67769e8b8 100644 --- a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js +++ b/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js @@ -14,8 +14,6 @@ import SidebarScreen from '../../../pages/home/sidebar/SidebarScreen'; import BaseDrawerNavigator from './BaseDrawerNavigator'; import * as ReportUtils from '../../ReportUtils'; import reportPropTypes from '../../../pages/reportPropTypes'; -import * as ReportActionContextMenu from '../../../pages/home/report/ContextMenu/ReportActionContextMenu'; -import PopoverReportActionContextMenu from '../../../pages/home/report/ContextMenu/PopoverReportActionContextMenu'; const propTypes = { /** Available reports that would be displayed in this navigator */ @@ -82,31 +80,26 @@ class MainDrawerNavigator extends Component { // This way routing information is updated (if needed) based on the initial report ID resolved. // This is usually needed after login/create account and re-launches return ( - <> - - { - // This state belongs to the drawer so it should always have the ReportScreen as it's initial (and only) route - const reportIDFromRoute = lodashGet(state, ['routes', 0, 'params', 'reportID']); - return ( - - ); - }} - screens={[ - { - name: SCREENS.REPORT, - component: ReportScreen, - initialParams: this.initialParams, - }, - ]} - isMainScreen - /> - + { + // This state belongs to the drawer so it should always have the ReportScreen as it's initial (and only) route + const reportIDFromRoute = lodashGet(state, ['routes', 0, 'params', 'reportID']); + return ( + + ); + }} + screens={[ + { + name: SCREENS.REPORT, + component: ReportScreen, + initialParams: this.initialParams, + }, + ]} + isMainScreen + /> ); } } From 240e2b70fe4479811bedbd7e39dbb56148d06082 Mon Sep 17 00:00:00 2001 From: christianwenifr Date: Fri, 20 Jan 2023 18:01:05 +0700 Subject: [PATCH 10/28] fix: issue --- .../home/report/ContextMenu/PopoverReportActionContextMenu.js | 4 ++-- src/pages/home/report/ContextMenu/ReportActionContextMenu.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js index 770844edc342..6a48c861cdf5 100644 --- a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js +++ b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js @@ -116,8 +116,8 @@ class PopoverReportActionContextMenu extends React.Component { * @param {String} draftMessage - ReportAction Draftmessage * @param {Function} [onShow] - Run a callback when Menu is shown * @param {Function} [onHide] - Run a callback when Menu is hidden - * @param {Boolean} isArchivedRoom - isArchivedRoom - * @param {Boolean} isChronosReport - isChronosReport + * @param {Boolean} isArchivedRoom - Whether the provided report is an archived room + * @param {Boolean} isChronosReport - Flag to check if the chat participant is Chronos */ showContextMenu( type, diff --git a/src/pages/home/report/ContextMenu/ReportActionContextMenu.js b/src/pages/home/report/ContextMenu/ReportActionContextMenu.js index 6acb7d5c33aa..df544f2e7202 100644 --- a/src/pages/home/report/ContextMenu/ReportActionContextMenu.js +++ b/src/pages/home/report/ContextMenu/ReportActionContextMenu.js @@ -14,8 +14,8 @@ const contextMenuRef = React.createRef(); * @param {String} draftMessage - ReportAction Draftmessage * @param {Function} [onShow=() => {}] - Run a callback when Menu is shown * @param {Function} [onHide=() => {}] - Run a callback when Menu is hidden - * @param {Boolean} isArchivedRoom - isArchivedRoom - * @param {Boolean} isChronosReport - isChronosReport + * @param {Boolean} isArchivedRoom - Whether the provided report is an archived room + * @param {Boolean} isChronosReport - Flag to check if the chat participant is Chronos */ function showContextMenu( type, From 6b2e0ff74fd529b8941a56ba69ca832040ec0b23 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Fri, 20 Jan 2023 15:06:48 +0100 Subject: [PATCH 11/28] Fix proptypes warning in MenuItemWithTopDescription --- src/pages/settings/Profile/LoginField.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Profile/LoginField.js b/src/pages/settings/Profile/LoginField.js index 172bd3847f2f..055000a045b9 100755 --- a/src/pages/settings/Profile/LoginField.js +++ b/src/pages/settings/Profile/LoginField.js @@ -97,7 +97,7 @@ class LoginField extends Component { interactive={Boolean(!this.props.login.partnerUserID)} onPress={this.props.login.partnerUserID ? () => { } : () => Navigation.navigate(ROUTES.getSettingsAddLoginRoute(this.props.type))} shouldShowRightIcon={Boolean(!this.props.login.partnerUserID)} - style={[!this.props.login.partnerUserID && styles.colorMuted]} + style={!this.props.login.partnerUserID ? styles.colorMuted : []} /> ) : ( From fb52a1f256d958915ad27214d4bef5abfff7ba52 Mon Sep 17 00:00:00 2001 From: Pujan Date: Thu, 12 Jan 2023 22:18:39 +0530 Subject: [PATCH 12/28] composer icons tooltip position fix --- src/pages/home/report/ReportActionCompose.js | 2 +- src/styles/styles.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index f88ea64b4fc4..74f1ef377190 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -560,7 +560,7 @@ class ReportActionCompose extends React.Component { {({openPicker}) => ( <> diff --git a/src/styles/styles.js b/src/styles/styles.js index e30b5f77b507..c0264fc71ba3 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1543,14 +1543,15 @@ const styles = { chatItemAttachBorder: { borderRightColor: themeColors.border, borderRightWidth: 1, + height: 32, + width: 32, marginBottom: 3, marginTop: 3, - + justifyContent: 'center', }, composerSizeButton: { alignItems: 'center', - alignSelf: 'flex-end', height: 26, marginBottom: 6, marginTop: 6, From d2ab08422ce590c277cd713c29f99b380e21fee4 Mon Sep 17 00:00:00 2001 From: Pujan Date: Sat, 14 Jan 2023 02:21:05 +0530 Subject: [PATCH 13/28] reverted extra code on resolving merge conflict --- src/styles/styles.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index c0264fc71ba3..d9f43f616ea1 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1543,11 +1543,8 @@ const styles = { chatItemAttachBorder: { borderRightColor: themeColors.border, borderRightWidth: 1, - height: 32, - width: 32, marginBottom: 3, marginTop: 3, - justifyContent: 'center', }, composerSizeButton: { From 18fe9796d492adedc4156e005695e9394d0bd228 Mon Sep 17 00:00:00 2001 From: Pujan Date: Sat, 14 Jan 2023 10:14:07 +0530 Subject: [PATCH 14/28] uniform style for the composer buttons --- src/pages/home/report/ReportActionCompose.js | 4 ++-- src/styles/styles.js | 25 +++++--------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 74f1ef377190..c287ca22341d 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -560,7 +560,7 @@ class ReportActionCompose extends React.Component { {({openPicker}) => ( <> @@ -610,7 +610,7 @@ class ReportActionCompose extends React.Component { this.actionButton.blur(); this.setMenuVisibility(true); }} - style={styles.chatItemAttachButton} + style={styles.composerSizeButton} disabled={isBlockedFromConcierge || this.props.disabled} > diff --git a/src/styles/styles.js b/src/styles/styles.js index d9f43f616ea1..891ed95b7b29 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1529,32 +1529,19 @@ const styles = { backgroundColor: themeColors.buttonHoveredBG, }, - chatItemAttachButton: { - alignSelf: 'flex-end', - borderRadius: variables.componentBorderRadiusRounded, - backgroundColor: themeColors.transparent, - height: 32, - padding: 6, - marginLeft: 3, - marginRight: 3, - justifyContent: 'center', - }, - chatItemAttachBorder: { borderRightColor: themeColors.border, borderRightWidth: 1, - marginBottom: 3, - marginTop: 3, }, composerSizeButton: { - alignItems: 'center', - height: 26, - marginBottom: 6, - marginTop: 6, - marginRight: 4, - justifyContent: 'center', + alignSelf: 'center', + height: 32, width: 32, + padding: 6, + margin: 3, + borderRadius: variables.componentBorderRadiusRounded, + backgroundColor: themeColors.transparent, }, chatItemAttachmentPlaceholder: { From c67f93ad315a5be437557fed591ff39ff3315511 Mon Sep 17 00:00:00 2001 From: Pujan Date: Fri, 20 Jan 2023 23:45:25 +0530 Subject: [PATCH 15/28] profile pic tooltip fix --- src/pages/home/report/ReportActionItemSingle.js | 2 +- src/styles/styles.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index bb1d39e62dc1..c90335a9da92 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -73,7 +73,7 @@ const ReportActionItemSingle = (props) => { return ( showUserDetails(props.action.actorEmail)} diff --git a/src/styles/styles.js b/src/styles/styles.js index 891ed95b7b29..0fd29f7c7ec8 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -709,7 +709,6 @@ const styles = { // Actions actionAvatar: { borderRadius: 20, - marginRight: variables.avatarChatSpacing, }, componentHeightLarge: { From 7e58d3ac2afe596e0a4b1ad318e45db133714afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Fri, 20 Jan 2023 17:37:04 -0600 Subject: [PATCH 16/28] bump react-native-onyx version --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a9997acfdcf..0ad7ffbe55e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,7 +69,7 @@ "react-native-image-picker": "^4.10.2", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.35", + "react-native-onyx": "1.0.36", "react-native-pdf": "^6.6.2", "react-native-performance": "^4.0.0", "react-native-permissions": "^3.0.1", @@ -35628,9 +35628,9 @@ } }, "node_modules/react-native-onyx": { - "version": "1.0.35", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.35.tgz", - "integrity": "sha512-HQDSM0c2ADb54NoSQdxqeJOhViICB9HwE8aMEB62AdHkRw6crCoIX7iSIF0ewbZ2A/hbX3frewWq8AUh3AyMvA==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.36.tgz", + "integrity": "sha512-7kMdj27dk4q9bD37Jg5t9lwQSR8Cjr/9KZPKBUvWhwCwzUeg9YmPaZfu6O22eiUPo9gk4Y5L2j/mQMmXq4wc/w==", "dependencies": { "ascii-table": "0.0.9", "fast-equals": "^4.0.3", @@ -70042,9 +70042,9 @@ } }, "react-native-onyx": { - "version": "1.0.35", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.35.tgz", - "integrity": "sha512-HQDSM0c2ADb54NoSQdxqeJOhViICB9HwE8aMEB62AdHkRw6crCoIX7iSIF0ewbZ2A/hbX3frewWq8AUh3AyMvA==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.36.tgz", + "integrity": "sha512-7kMdj27dk4q9bD37Jg5t9lwQSR8Cjr/9KZPKBUvWhwCwzUeg9YmPaZfu6O22eiUPo9gk4Y5L2j/mQMmXq4wc/w==", "requires": { "ascii-table": "0.0.9", "fast-equals": "^4.0.3", diff --git a/package.json b/package.json index 704be0d45ed5..24fe74c7d1d1 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "react-native-image-picker": "^4.10.2", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.35", + "react-native-onyx": "1.0.36", "react-native-pdf": "^6.6.2", "react-native-performance": "^4.0.0", "react-native-permissions": "^3.0.1", From d89e66e2ee61f1769ee0131b64e489cff9bb6986 Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 20 Jan 2023 17:26:49 -0800 Subject: [PATCH 17/28] Write tests for onyxUpdate filter func --- tests/unit/ReportActionsUtilsTest.js | 147 +++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/tests/unit/ReportActionsUtilsTest.js b/tests/unit/ReportActionsUtilsTest.js index 8431555a8985..c1cbfe638a61 100644 --- a/tests/unit/ReportActionsUtilsTest.js +++ b/tests/unit/ReportActionsUtilsTest.js @@ -1,5 +1,6 @@ import CONST from '../../src/CONST'; import * as ReportActionsUtils from '../../src/libs/ReportActionsUtils'; +import ONYXKEYS from '../../src/ONYXKEYS'; describe('ReportActionsUtils', () => { describe('getSortedReportActions', () => { @@ -192,4 +193,150 @@ describe('ReportActionsUtils', () => { expect(result).toStrictEqual(input); }); }); + + describe('filterReportActionIDKeyedOnyxUpdates', () => { + it('should not error with an empty value', () => { + expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates()).toStrictEqual([]); + }); + + it('should not error with an empty array', () => { + expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates([])).toStrictEqual([]); + }); + + it('should not affect any Onyx update not including reportActions data', () => { + const onyxUpdates = [ + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}1234`, + value: { + pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, + errors: null, + }, + }, + ]; + expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxUpdates)).toStrictEqual(onyxUpdates); + }); + + it('should not affect a sequenceNumber-keyed Onyx update', () => { + const onyxUpdates = [ + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}1234`, + value: { + reportID: 1234, + }, + }, + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, + value: { + 1: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + ]; + expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxUpdates)).toStrictEqual(onyxUpdates); + }); + + it('should reject a reportActionID-keyed Onyx update', () => { + expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates([ + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, + value: { + 54321: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + ])).toStrictEqual([]); + }); + + it('should work with multiple reportActions Onyx updates', () => { + const onyxUpdates = [ + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, + value: { + 1: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4321`, + value: { + 1: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + ]; + expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxUpdates)).toStrictEqual(onyxUpdates); + }); + + it('should filter out reportAction Onyx updates keyed by reportActionID, leaving those keyed by sequenceNumber in place', () => { + const input = [ + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, + value: { + 1: { + sequenceNumber: 1, + reportActionID: '54321', + }, + 54321: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4321`, + value: { + 1: { + sequenceNumber: 1, + reportActionID: '54321', + }, + 54321: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + ]; + + const expectedOutput = [ + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, + value: { + 1: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4321`, + value: { + 1: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + ]; + + expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(input)).toStrictEqual(expectedOutput); + }); + }); }); From de1c8c20d66a8286b33d566d222bfe0276e04ba5 Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 20 Jan 2023 17:34:45 -0800 Subject: [PATCH 18/28] Implement ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates --- src/libs/ReportActionsUtils.js | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index bb67b2fb39b6..82f5463063ae 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -173,6 +173,46 @@ function getLastVisibleMessageText(reportID, actionsToMerge = {}) { return ReportUtils.formatReportLastMessageText(messageText); } +/** + * Given an array of Onyx updates, this function will filter out any which attempt to update reportActions data using reportActionID as the key. + * It is a TEMPORARY measure while we migrate the shape of reportActions Onyx data. Additional context: + * + * - In GitHub: https://github.com/Expensify/App/issues/14452 + * - In Slack: https://expensify.slack.com/archives/C04DC6LU2UB/p1674243288556829?thread_ts=1674242808.964579&cid=C04DC6LU2UB + * + * @param {Array} onyxUpdates – each Onyx update typically has shape: {onyxMethod: string, key: string, value: object} + * @returns {Array} + */ +function filterReportActionIDKeyedOnyxUpdates(onyxUpdates) { + return _.reduce( + onyxUpdates, + (memo, onyxUpdate) => { + if (!onyxUpdate.key.startsWith(ONYXKEYS.COLLECTION.REPORT_ACTIONS)) { + memo.push(onyxUpdate); + return memo; + } + + const newValue = {}; + _.each(onyxUpdate.value, (reportAction, key) => { + if (reportAction.reportActionID === key) { + return; + } + newValue[key] = reportAction; + }); + + if (_.isEmpty(newValue)) { + return memo; + } + + // eslint-disable-next-line no-param-reassign + onyxUpdate.value = newValue; + memo.push(onyxUpdate); + return memo; + }, + [], + ); +} + export { getSortedReportActions, filterReportActionsForDisplay, @@ -181,4 +221,5 @@ export { getMostRecentIOUReportActionID, isDeletedAction, isConsecutiveActionMadeByPreviousActor, + filterReportActionIDKeyedOnyxUpdates, }; From a69b9af5ae5a7d1111fdb52d0949c7c481234082 Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 20 Jan 2023 17:38:46 -0800 Subject: [PATCH 19/28] Use filter on incoming onyx updates --- src/libs/ReportActionsUtils.js | 2 +- src/libs/actions/Report.js | 3 ++- src/libs/actions/User.js | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index 82f5463063ae..16058ba42f27 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -180,7 +180,7 @@ function getLastVisibleMessageText(reportID, actionsToMerge = {}) { * - In GitHub: https://github.com/Expensify/App/issues/14452 * - In Slack: https://expensify.slack.com/archives/C04DC6LU2UB/p1674243288556829?thread_ts=1674242808.964579&cid=C04DC6LU2UB * - * @param {Array} onyxUpdates – each Onyx update typically has shape: {onyxMethod: string, key: string, value: object} + * @param {Array} onyxUpdates – each Onyx update typically has shape: {onyxMethod: string, key: string, value: *} * @returns {Array} */ function filterReportActionIDKeyedOnyxUpdates(onyxUpdates) { diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 78faeaa3e3a9..9329e098914e 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -63,7 +63,8 @@ function getReportChannelName(reportID) { function subscribeToReportCommentPushNotifications() { PushNotification.onReceived(PushNotification.TYPE.REPORT_COMMENT, ({reportID, onyxData}) => { Log.info('[Report] Handled event sent by Airship', false, {reportID}); - Onyx.update(onyxData); + const filteredOnyxData = ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxData); + Onyx.update(filteredOnyxData); }); // Open correct report when push notification is clicked diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 09e7d6873084..62f9c6bd1072 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -285,8 +285,9 @@ function subscribeToUserEvents() { // Receive any relevant Onyx updates from the server PusherUtils.subscribeToPrivateUserChannelEvent(Pusher.TYPE.ONYX_API_UPDATE, currentUserAccountID, (pushJSON) => { SequentialQueue.getCurrentRequest().then(() => { - Onyx.update(pushJSON); - triggerNotifications(pushJSON); + const filteredOnyxUpdate = ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(pushJSON); + Onyx.update(filteredOnyxUpdate); + triggerNotifications(filteredOnyxUpdate); }); }); From bd31ac454a67c762be17d837329ebe96781a361a Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 20 Jan 2023 17:58:14 -0800 Subject: [PATCH 20/28] Address edge case with null reportAction data --- src/libs/ReportActionsUtils.js | 2 +- tests/unit/ReportActionsUtilsTest.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index 16058ba42f27..02c6a3de011c 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -194,7 +194,7 @@ function filterReportActionIDKeyedOnyxUpdates(onyxUpdates) { const newValue = {}; _.each(onyxUpdate.value, (reportAction, key) => { - if (reportAction.reportActionID === key) { + if (reportAction && reportAction.reportActionID === key) { return; } newValue[key] = reportAction; diff --git a/tests/unit/ReportActionsUtilsTest.js b/tests/unit/ReportActionsUtilsTest.js index c1cbfe638a61..e8e008df3336 100644 --- a/tests/unit/ReportActionsUtilsTest.js +++ b/tests/unit/ReportActionsUtilsTest.js @@ -338,5 +338,22 @@ describe('ReportActionsUtils', () => { expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(input)).toStrictEqual(expectedOutput); }); + + it('should not filter out the removal of any clientID-keyed reportAction', () => { + const onyxUpdates = [ + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4321`, + value: { + 123135135: null, + 1: { + sequenceNumber: 1, + reportActionID: '54321', + }, + }, + }, + ]; + expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxUpdates)).toStrictEqual(onyxUpdates); + }); }); }); From 727a4dc0d300277c25539aa462f71a9291c4820b Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 20 Jan 2023 18:03:54 -0800 Subject: [PATCH 21/28] Fix actions/Report test --- tests/actions/ReportTest.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/actions/ReportTest.js b/tests/actions/ReportTest.js index 0918dda3ec40..8ad282d2f3cc 100644 --- a/tests/actions/ReportTest.js +++ b/tests/actions/ReportTest.js @@ -18,6 +18,7 @@ import * as PersistedRequests from '../../src/libs/actions/PersistedRequests'; import * as User from '../../src/libs/actions/User'; import * as ReportUtils from '../../src/libs/ReportUtils'; import DateUtils from '../../src/libs/DateUtils'; +import * as NumberUtils from '../../src/libs/NumberUtils'; jest.mock('../../src/libs/actions/Report', () => { const originalModule = jest.requireActual('../../src/libs/actions/Report'); @@ -65,8 +66,8 @@ describe('actions/Report', () => { const TEST_USER_ACCOUNT_ID = 1; const TEST_USER_LOGIN = 'test@test.com'; const REPORT_ID = 1; - const ACTION_ID = 1; const REPORT_ACTION = { + reportActionID: NumberUtils.rand64(), actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, actorAccountID: TEST_USER_ACCOUNT_ID, actorEmail: TEST_USER_LOGIN, @@ -74,7 +75,7 @@ describe('actions/Report', () => { avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', message: [{type: 'COMMENT', html: 'Testing a comment', text: 'Testing a comment'}], person: [{type: 'TEXT', style: 'strong', text: 'Test User'}], - sequenceNumber: ACTION_ID, + sequenceNumber: 1, shouldShow: true, }; @@ -131,7 +132,7 @@ describe('actions/Report', () => { key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, value: { [clientID]: null, - [ACTION_ID]: actionWithoutLoading, + 1: actionWithoutLoading, }, }, ]); @@ -145,7 +146,7 @@ describe('actions/Report', () => { // Verify there is only one action and our optimistic comment has been removed expect(_.size(reportActions)).toBe(1); - const resultAction = reportActions[ACTION_ID]; + const resultAction = reportActions[1]; // Verify that our action is no longer in the loading state expect(resultAction.pendingAction).not.toBeDefined(); @@ -354,9 +355,9 @@ describe('actions/Report', () => { onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, value: { + [_.toArray(reportActions)[0].clientID]: null, [_.toArray(reportActions)[1].clientID]: null, [_.toArray(reportActions)[2].clientID]: null, - [_.toArray(reportActions)[3].clientID]: null, 2: { ...USER_1_BASE_ACTION, message: [{type: 'COMMENT', html: 'Current User Comment 1', text: 'Current User Comment 1'}], From d858ba7333e7e4a40b93407f749a20f207d820f1 Mon Sep 17 00:00:00 2001 From: christianwenifr Date: Mon, 23 Jan 2023 19:26:25 +0700 Subject: [PATCH 22/28] fix: comment --- .../home/report/ContextMenu/PopoverReportActionContextMenu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js index 6a48c861cdf5..dd637193b0e9 100644 --- a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js +++ b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js @@ -311,8 +311,8 @@ class PopoverReportActionContextMenu extends React.Component { reportID={this.state.reportID} reportAction={this.state.reportAction} draftMessage={this.state.reportActionDraftMessage} - isArchivedRoom={this.props.isArchivedRoom} - isChronosReport={this.props.isChronosReport} + isArchivedRoom={this.state.isArchivedRoom} + isChronosReport={this.state.isChronosReport} anchor={this.contextMenuTargetNode} /> From dbe1def0119c6a38b982299240177617dd3a1ee3 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 23 Jan 2023 12:26:53 +0000 Subject: [PATCH 23/28] Update version to 1.2.57-3 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 45faaf1c4f04..b3b5dc98ed40 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001025702 - versionName "1.2.57-2" + versionCode 1001025703 + versionName "1.2.57-3" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index fb94fb7e9e8a..8f2664e30eea 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.57.2 + 1.2.57.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 4ca474c2832d..d2dab9ff6531 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.2.57.2 + 1.2.57.3 diff --git a/package-lock.json b/package-lock.json index 933a8e45f04d..e15a8fc2f5e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.57-2", + "version": "1.2.57-3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.57-2", + "version": "1.2.57-3", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 64cf3942237c..674ae9f755af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.57-2", + "version": "1.2.57-3", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From a06c4c702e0a0a05783bd16cb2345e7ebb418f84 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 23 Jan 2023 16:31:52 +0000 Subject: [PATCH 24/28] Update version to 1.2.58-0 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 4 ++-- ios/NewExpensifyTests/Info.plist | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index b3b5dc98ed40..fe832bd1e42d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001025703 - versionName "1.2.57-3" + versionCode 1001025800 + versionName "1.2.58-0" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 8f2664e30eea..9368e0f3fc23 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.2.57 + 1.2.58 CFBundleSignature ???? CFBundleURLTypes @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.57.3 + 1.2.58.0 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index d2dab9ff6531..ed577c5c5f03 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.2.57 + 1.2.58 CFBundleSignature ???? CFBundleVersion - 1.2.57.3 + 1.2.58.0 diff --git a/package-lock.json b/package-lock.json index e15a8fc2f5e2..0de167bcd320 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.57-3", + "version": "1.2.58-0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.57-3", + "version": "1.2.58-0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 674ae9f755af..21b5e573c366 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.57-3", + "version": "1.2.58-0", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 6b344c254547f47cbf71e3db3e2fbfb05b8bdb6a Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 23 Jan 2023 17:54:26 +0000 Subject: [PATCH 25/28] Update version to 1.2.58-1 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index fe832bd1e42d..450facd8f532 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001025800 - versionName "1.2.58-0" + versionCode 1001025801 + versionName "1.2.58-1" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 9368e0f3fc23..6d5f517d456f 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.58.0 + 1.2.58.1 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index ed577c5c5f03..fd5969c26ab0 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.2.58.0 + 1.2.58.1 diff --git a/package-lock.json b/package-lock.json index 0de167bcd320..73ceda674a09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.58-0", + "version": "1.2.58-1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.58-0", + "version": "1.2.58-1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 21b5e573c366..2975bb209385 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.58-0", + "version": "1.2.58-1", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 1c280884f7c46afdba037f121a3ac24ce96d496b Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 23 Jan 2023 20:03:34 +0000 Subject: [PATCH 26/28] Update version to 1.2.58-2 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 450facd8f532..4a6b8b0df5e3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001025801 - versionName "1.2.58-1" + versionCode 1001025802 + versionName "1.2.58-2" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 6d5f517d456f..30cf1a367b23 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.58.1 + 1.2.58.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index fd5969c26ab0..6e8645c4d679 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.2.58.1 + 1.2.58.2 diff --git a/package-lock.json b/package-lock.json index 73ceda674a09..56ea4f4a9d6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.58-1", + "version": "1.2.58-2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.58-1", + "version": "1.2.58-2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 2975bb209385..bcf627076bdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.58-1", + "version": "1.2.58-2", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 3ccb0772eeab2082fec2bd0100d6cca7715516eb Mon Sep 17 00:00:00 2001 From: Rory Abraham <47436092+roryabraham@users.noreply.github.com> Date: Mon, 23 Jan 2023 13:50:57 -0800 Subject: [PATCH 27/28] Revert "[No QA] Filter out reportActionID-keyed Onyx updates" --- src/libs/ReportActionsUtils.js | 41 ------- src/libs/actions/Report.js | 3 +- src/libs/actions/User.js | 5 +- tests/actions/ReportTest.js | 11 +- tests/unit/ReportActionsUtilsTest.js | 164 --------------------------- 5 files changed, 8 insertions(+), 216 deletions(-) diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index 02c6a3de011c..bb67b2fb39b6 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -173,46 +173,6 @@ function getLastVisibleMessageText(reportID, actionsToMerge = {}) { return ReportUtils.formatReportLastMessageText(messageText); } -/** - * Given an array of Onyx updates, this function will filter out any which attempt to update reportActions data using reportActionID as the key. - * It is a TEMPORARY measure while we migrate the shape of reportActions Onyx data. Additional context: - * - * - In GitHub: https://github.com/Expensify/App/issues/14452 - * - In Slack: https://expensify.slack.com/archives/C04DC6LU2UB/p1674243288556829?thread_ts=1674242808.964579&cid=C04DC6LU2UB - * - * @param {Array} onyxUpdates – each Onyx update typically has shape: {onyxMethod: string, key: string, value: *} - * @returns {Array} - */ -function filterReportActionIDKeyedOnyxUpdates(onyxUpdates) { - return _.reduce( - onyxUpdates, - (memo, onyxUpdate) => { - if (!onyxUpdate.key.startsWith(ONYXKEYS.COLLECTION.REPORT_ACTIONS)) { - memo.push(onyxUpdate); - return memo; - } - - const newValue = {}; - _.each(onyxUpdate.value, (reportAction, key) => { - if (reportAction && reportAction.reportActionID === key) { - return; - } - newValue[key] = reportAction; - }); - - if (_.isEmpty(newValue)) { - return memo; - } - - // eslint-disable-next-line no-param-reassign - onyxUpdate.value = newValue; - memo.push(onyxUpdate); - return memo; - }, - [], - ); -} - export { getSortedReportActions, filterReportActionsForDisplay, @@ -221,5 +181,4 @@ export { getMostRecentIOUReportActionID, isDeletedAction, isConsecutiveActionMadeByPreviousActor, - filterReportActionIDKeyedOnyxUpdates, }; diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 9329e098914e..78faeaa3e3a9 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -63,8 +63,7 @@ function getReportChannelName(reportID) { function subscribeToReportCommentPushNotifications() { PushNotification.onReceived(PushNotification.TYPE.REPORT_COMMENT, ({reportID, onyxData}) => { Log.info('[Report] Handled event sent by Airship', false, {reportID}); - const filteredOnyxData = ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxData); - Onyx.update(filteredOnyxData); + Onyx.update(onyxData); }); // Open correct report when push notification is clicked diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 62f9c6bd1072..09e7d6873084 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -285,9 +285,8 @@ function subscribeToUserEvents() { // Receive any relevant Onyx updates from the server PusherUtils.subscribeToPrivateUserChannelEvent(Pusher.TYPE.ONYX_API_UPDATE, currentUserAccountID, (pushJSON) => { SequentialQueue.getCurrentRequest().then(() => { - const filteredOnyxUpdate = ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(pushJSON); - Onyx.update(filteredOnyxUpdate); - triggerNotifications(filteredOnyxUpdate); + Onyx.update(pushJSON); + triggerNotifications(pushJSON); }); }); diff --git a/tests/actions/ReportTest.js b/tests/actions/ReportTest.js index 8ad282d2f3cc..0918dda3ec40 100644 --- a/tests/actions/ReportTest.js +++ b/tests/actions/ReportTest.js @@ -18,7 +18,6 @@ import * as PersistedRequests from '../../src/libs/actions/PersistedRequests'; import * as User from '../../src/libs/actions/User'; import * as ReportUtils from '../../src/libs/ReportUtils'; import DateUtils from '../../src/libs/DateUtils'; -import * as NumberUtils from '../../src/libs/NumberUtils'; jest.mock('../../src/libs/actions/Report', () => { const originalModule = jest.requireActual('../../src/libs/actions/Report'); @@ -66,8 +65,8 @@ describe('actions/Report', () => { const TEST_USER_ACCOUNT_ID = 1; const TEST_USER_LOGIN = 'test@test.com'; const REPORT_ID = 1; + const ACTION_ID = 1; const REPORT_ACTION = { - reportActionID: NumberUtils.rand64(), actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, actorAccountID: TEST_USER_ACCOUNT_ID, actorEmail: TEST_USER_LOGIN, @@ -75,7 +74,7 @@ describe('actions/Report', () => { avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', message: [{type: 'COMMENT', html: 'Testing a comment', text: 'Testing a comment'}], person: [{type: 'TEXT', style: 'strong', text: 'Test User'}], - sequenceNumber: 1, + sequenceNumber: ACTION_ID, shouldShow: true, }; @@ -132,7 +131,7 @@ describe('actions/Report', () => { key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, value: { [clientID]: null, - 1: actionWithoutLoading, + [ACTION_ID]: actionWithoutLoading, }, }, ]); @@ -146,7 +145,7 @@ describe('actions/Report', () => { // Verify there is only one action and our optimistic comment has been removed expect(_.size(reportActions)).toBe(1); - const resultAction = reportActions[1]; + const resultAction = reportActions[ACTION_ID]; // Verify that our action is no longer in the loading state expect(resultAction.pendingAction).not.toBeDefined(); @@ -355,9 +354,9 @@ describe('actions/Report', () => { onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, value: { - [_.toArray(reportActions)[0].clientID]: null, [_.toArray(reportActions)[1].clientID]: null, [_.toArray(reportActions)[2].clientID]: null, + [_.toArray(reportActions)[3].clientID]: null, 2: { ...USER_1_BASE_ACTION, message: [{type: 'COMMENT', html: 'Current User Comment 1', text: 'Current User Comment 1'}], diff --git a/tests/unit/ReportActionsUtilsTest.js b/tests/unit/ReportActionsUtilsTest.js index e8e008df3336..8431555a8985 100644 --- a/tests/unit/ReportActionsUtilsTest.js +++ b/tests/unit/ReportActionsUtilsTest.js @@ -1,6 +1,5 @@ import CONST from '../../src/CONST'; import * as ReportActionsUtils from '../../src/libs/ReportActionsUtils'; -import ONYXKEYS from '../../src/ONYXKEYS'; describe('ReportActionsUtils', () => { describe('getSortedReportActions', () => { @@ -193,167 +192,4 @@ describe('ReportActionsUtils', () => { expect(result).toStrictEqual(input); }); }); - - describe('filterReportActionIDKeyedOnyxUpdates', () => { - it('should not error with an empty value', () => { - expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates()).toStrictEqual([]); - }); - - it('should not error with an empty array', () => { - expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates([])).toStrictEqual([]); - }); - - it('should not affect any Onyx update not including reportActions data', () => { - const onyxUpdates = [ - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.POLICY}1234`, - value: { - pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, - errors: null, - }, - }, - ]; - expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxUpdates)).toStrictEqual(onyxUpdates); - }); - - it('should not affect a sequenceNumber-keyed Onyx update', () => { - const onyxUpdates = [ - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT}1234`, - value: { - reportID: 1234, - }, - }, - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, - value: { - 1: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - ]; - expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxUpdates)).toStrictEqual(onyxUpdates); - }); - - it('should reject a reportActionID-keyed Onyx update', () => { - expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates([ - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, - value: { - 54321: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - ])).toStrictEqual([]); - }); - - it('should work with multiple reportActions Onyx updates', () => { - const onyxUpdates = [ - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, - value: { - 1: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4321`, - value: { - 1: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - ]; - expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxUpdates)).toStrictEqual(onyxUpdates); - }); - - it('should filter out reportAction Onyx updates keyed by reportActionID, leaving those keyed by sequenceNumber in place', () => { - const input = [ - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, - value: { - 1: { - sequenceNumber: 1, - reportActionID: '54321', - }, - 54321: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4321`, - value: { - 1: { - sequenceNumber: 1, - reportActionID: '54321', - }, - 54321: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - ]; - - const expectedOutput = [ - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1234`, - value: { - 1: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4321`, - value: { - 1: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - ]; - - expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(input)).toStrictEqual(expectedOutput); - }); - - it('should not filter out the removal of any clientID-keyed reportAction', () => { - const onyxUpdates = [ - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4321`, - value: { - 123135135: null, - 1: { - sequenceNumber: 1, - reportActionID: '54321', - }, - }, - }, - ]; - expect(ReportActionsUtils.filterReportActionIDKeyedOnyxUpdates(onyxUpdates)).toStrictEqual(onyxUpdates); - }); - }); }); From 59e82634c9766abf864bf5bd258297c3079b9a51 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 23 Jan 2023 22:00:23 +0000 Subject: [PATCH 28/28] Update version to 1.2.58-3 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 4a6b8b0df5e3..308156e3acba 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001025802 - versionName "1.2.58-2" + versionCode 1001025803 + versionName "1.2.58-3" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 30cf1a367b23..99798a262963 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.58.2 + 1.2.58.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 6e8645c4d679..377a0034c8eb 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.2.58.2 + 1.2.58.3 diff --git a/package-lock.json b/package-lock.json index 56ea4f4a9d6c..e9b4f3c57be1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.58-2", + "version": "1.2.58-3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.58-2", + "version": "1.2.58-3", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index bcf627076bdf..d3dca9b00da5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.58-2", + "version": "1.2.58-3", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",