author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
129,184
12.07.2021 11:55:02
14,400
c28559e08ddacd1231304da3c81403dcf9e2fceb
[native] Restyle `Calendar` component Summary: Before: After: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/calendar/calendar.react.js", "new_path": "native/calendar/calendar.react.js", "diff": "@@ -1030,7 +1030,7 @@ const unboundStyles = {\nbottom: 0,\n},\nsectionHeader: {\n- backgroundColor: 'listSeparator',\n+ backgroundColor: 'panelForeground',\nborderBottomWidth: 2,\nborderColor: 'listBackground',\nheight: 31,\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/section-footer.react.js", "new_path": "native/calendar/section-footer.react.js", "diff": "import * as React from 'react';\nimport { View, Text, TouchableWithoutFeedback } from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\nimport Button from '../components/button.react';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { type Colors, useStyles, useColors } from '../themes/colors';\ntype BaseProps = {|\n@@ -19,19 +19,15 @@ type Props = {|\n|};\nclass SectionFooter extends React.PureComponent<Props> {\nrender() {\n- const { modalIosHighlightUnderlay: underlayColor } = this.props.colors;\nreturn (\n<TouchableWithoutFeedback onPress={this.props.onPressWhitespace}>\n<View style={this.props.styles.sectionFooter}>\n- <Button\n- onPress={this.onSubmit}\n- iosFormat=\"highlight\"\n- iosHighlightUnderlayColor={underlayColor}\n- iosActiveOpacity={0.85}\n- style={this.props.styles.addButton}\n- >\n+ <Button onPress={this.onSubmit} style={this.props.styles.addButton}>\n<View style={this.props.styles.addButtonContents}>\n- <Icon name=\"plus\" style={this.props.styles.addIcon} />\n+ <SWMansionIcon\n+ name=\"plus-circle\"\n+ style={this.props.styles.addIcon}\n+ />\n<Text style={this.props.styles.actionLinksText}>Add</Text>\n</View>\n</Button>\n@@ -51,7 +47,7 @@ const unboundStyles = {\nfontWeight: 'bold',\n},\naddButton: {\n- backgroundColor: 'listSeparator',\n+ backgroundColor: 'panelForeground',\nborderRadius: 5,\nmargin: 5,\npaddingBottom: 5,\n@@ -65,8 +61,8 @@ const unboundStyles = {\n},\naddIcon: {\ncolor: 'listSeparatorLabel',\n- fontSize: 14,\n- paddingRight: 6,\n+ fontSize: 18,\n+ paddingRight: 4,\n},\nsectionFooter: {\nalignItems: 'flex-start',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Restyle `Calendar` component Summary: Before: https://blob.sh/atul/caledar-reskin-before.png After: https://blob.sh/atul/calendar-reskin-after.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1669
129,184
12.07.2021 12:32:46
14,400
f1b501efbb831240d069e8f38ad450b00fc2d9dc
[native] Restyle `SaveSettingButton` Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/settings/save-setting-button.react.js", "new_path": "native/chat/settings/save-setting-button.react.js", "diff": "import * as React from 'react';\nimport { TouchableOpacity } from 'react-native';\n-import Icon from 'react-native-vector-icons/Ionicons';\n+import SWMansionIcon from '../../components/swmansion-icon.react';\nimport { useStyles } from '../../themes/colors';\ntype Props = {|\n@@ -12,21 +12,15 @@ type Props = {|\nfunction SaveSettingButton(props: Props) {\nconst styles = useStyles(unboundStyles);\nreturn (\n- <TouchableOpacity onPress={props.onPress} style={styles.container}>\n- <Icon name=\"md-checkbox-outline\" size={24} style={styles.editIcon} />\n+ <TouchableOpacity onPress={props.onPress}>\n+ <SWMansionIcon name=\"check-circle\" size={20} style={styles.saveIcon} />\n</TouchableOpacity>\n);\n}\nconst unboundStyles = {\n- container: {\n- width: 26,\n- },\n- editIcon: {\n- color: 'greenButton',\n- position: 'absolute',\n- right: 0,\n- top: -3,\n+ saveIcon: {\n+ color: 'modalForegroundSecondaryLabel',\n},\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Restyle `SaveSettingButton` Summary: Here's how it looks: https://blob.sh/atul/d355.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1670
129,184
12.07.2021 13:57:51
14,400
515e2458c660c9163e2780cd19120c50723bd53d
[native] Restyle check mark Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/profile/appearance-preferences.react.js", "new_path": "native/profile/appearance-preferences.react.js", "diff": "import * as React from 'react';\nimport { View, Text, ScrollView, Platform } from 'react-native';\n-import Icon from 'react-native-vector-icons/Ionicons';\nimport { useDispatch } from 'react-redux';\nimport type { Dispatch } from 'lib/types/redux-types';\nimport Button from '../components/button.react';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { updateThemeInfoActionType } from '../redux/action-types';\nimport { useSelector } from '../redux/redux-utils';\nimport { type Colors, useColors, useStyles } from '../themes/colors';\n@@ -18,10 +18,10 @@ import {\n} from '../types/themes';\nconst CheckIcon = () => (\n- <Icon\n- name=\"md-checkmark\"\n+ <SWMansionIcon\n+ name=\"check\"\nsize={20}\n- color=\"#008800\"\n+ color=\"#888888\"\nstyle={unboundStyles.icon}\n/>\n);\n" }, { "change_type": "MODIFY", "old_path": "native/profile/dev-tools.react.js", "new_path": "native/profile/dev-tools.react.js", "diff": "import * as React from 'react';\nimport { View, Text, ScrollView, Platform } from 'react-native';\nimport ExitApp from 'react-native-exit-app';\n-import Icon from 'react-native-vector-icons/Ionicons';\nimport { useDispatch } from 'react-redux';\nimport type { Dispatch } from 'lib/types/redux-types';\nimport { setURLPrefix } from 'lib/utils/url-utils';\nimport Button from '../components/button.react';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport type { NavigationRoute } from '../navigation/route-names';\nimport { CustomServerModalRouteName } from '../navigation/route-names';\nimport { useSelector } from '../redux/redux-utils';\n@@ -20,10 +20,10 @@ import { nodeServerOptions } from '../utils/url-utils';\nimport type { ProfileNavigationProp } from './profile.react';\nconst ServerIcon = () => (\n- <Icon\n- name=\"md-checkmark\"\n+ <SWMansionIcon\n+ name=\"check\"\nsize={20}\n- color=\"#008800\"\n+ color=\"#888888\"\nstyle={unboundStyles.icon}\n/>\n);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Restyle check mark Summary: Here's what it looks like: https://blob.sh/atul/3d1b.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1671
129,184
12.07.2021 14:31:31
14,400
78abc2a03330e25ae5b670129fbbd28f986937aa
[native] Restyle preference buttons Summary: Here's how it looks: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/profile/appearance-preferences.react.js", "new_path": "native/profile/appearance-preferences.react.js", "diff": "@@ -65,6 +65,7 @@ class AppearancePreferences extends React.PureComponent<Props> {\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\nkey={`button_${themePreference}`}\n>\n<Text style={this.props.styles.option}>{text}</Text>\n" }, { "change_type": "MODIFY", "old_path": "native/profile/dev-tools.react.js", "new_path": "native/profile/dev-tools.react.js", "diff": "@@ -53,6 +53,7 @@ class DevTools extends React.PureComponent<Props> {\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\nkey={`server${server}`}\n>\n<Text style={this.props.styles.serverText}>{server}</Text>\n@@ -88,6 +89,7 @@ class DevTools extends React.PureComponent<Props> {\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\nkey=\"customServer\"\n>\n{customServerLabel}\n@@ -107,6 +109,7 @@ class DevTools extends React.PureComponent<Props> {\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.redText}>Trigger a crash</Text>\n</Button>\n@@ -116,6 +119,7 @@ class DevTools extends React.PureComponent<Props> {\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.redText}>Kill the app</Text>\n</Button>\n@@ -125,6 +129,7 @@ class DevTools extends React.PureComponent<Props> {\nstyle={this.props.styles.row}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.redText}>\nWipe state and kill app\n" }, { "change_type": "MODIFY", "old_path": "native/profile/profile-screen.react.js", "new_path": "native/profile/profile-screen.react.js", "diff": "@@ -82,6 +82,7 @@ class ProfileScreen extends React.PureComponent<Props> {\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.submenuText}>Appearance</Text>\n<Icon name=\"ios-arrow-forward\" size={20} color={navigationChevron} />\n@@ -93,6 +94,7 @@ class ProfileScreen extends React.PureComponent<Props> {\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.submenuText}>Developer tools</Text>\n<Icon name=\"ios-arrow-forward\" size={20} color={navigationChevron} />\n@@ -145,6 +147,7 @@ class ProfileScreen extends React.PureComponent<Props> {\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.submenuText}>Friend list</Text>\n<Icon\n@@ -158,6 +161,7 @@ class ProfileScreen extends React.PureComponent<Props> {\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.submenuText}>Block list</Text>\n<Icon\n@@ -176,6 +180,7 @@ class ProfileScreen extends React.PureComponent<Props> {\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.submenuText}>Privacy</Text>\n<Icon\n@@ -192,6 +197,7 @@ class ProfileScreen extends React.PureComponent<Props> {\nstyle={this.props.styles.submenuButton}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.submenuText}>Build info</Text>\n<Icon\n@@ -208,6 +214,7 @@ class ProfileScreen extends React.PureComponent<Props> {\nstyle={this.props.styles.deleteAccountButton}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={underlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.deleteAccountText}>\nDelete account...\n@@ -371,7 +378,7 @@ const unboundStyles = {\nborderColor: 'panelForegroundBorder',\nborderTopWidth: 1,\nmarginBottom: 24,\n- paddingVertical: 2,\n+ paddingVertical: 1,\n},\nsubmenuButton: {\nflexDirection: 'row',\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -95,7 +95,7 @@ const dark: Colors = Object.freeze({\npanelForegroundLabel: 'white',\npanelForegroundSecondaryLabel: '#CCCCCC',\npanelForegroundTertiaryLabel: '#AAAAAA',\n- panelIosHighlightUnderlay: '#444444DD',\n+ panelIosHighlightUnderlay: '#313035',\npanelSecondaryForeground: '#333333',\npanelSecondaryForegroundBorder: '#666666',\nmodalForeground: '#1C1C1E',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Restyle preference buttons Summary: Here's how it looks: https://blob.sh/atul/preference-button-selected.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1672
129,184
12.07.2021 14:57:42
14,400
d1762b3c1cbcacf6c9bd534c9d8a84936f32004e
[native] Change `ParentThreadHeader` background and add bottom border Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/parent-thread-header.react.js", "new_path": "native/chat/parent-thread-header.react.js", "diff": "@@ -51,7 +51,9 @@ const height = 48;\nconst unboundStyles = {\ncontainer: {\nheight,\n- backgroundColor: 'modalSubtext',\n+ backgroundColor: 'panelForeground',\n+ borderBottomWidth: 1,\n+ borderBottomColor: 'panelForegroundBorder',\n},\ncontentContainer: {\nalignItems: 'center',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Change `ParentThreadHeader` background and add bottom border Summary: Here's what it looks like: https://blob.sh/atul/5757.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1673
129,184
12.07.2021 15:20:06
14,400
ac904b4a3d5d9a686584268bc373844f5413eb23
Tweak `ThreadSettingsDescription` style Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-description.react.js", "new_path": "native/chat/settings/thread-settings-description.react.js", "diff": "@@ -142,6 +142,7 @@ class ThreadSettingsDescription extends React.PureComponent<Props> {\nstyle={this.props.styles.addDescriptionButton}\niosFormat=\"highlight\"\niosHighlightUnderlayColor={panelIosHighlightUnderlay}\n+ iosActiveOpacity={0.85}\n>\n<Text style={this.props.styles.addDescriptionText}>\nAdd a description...\n@@ -249,7 +250,7 @@ const unboundStyles = {\n},\noutlineCategory: {\nbackgroundColor: 'panelForeground',\n- borderColor: 'panelSecondaryForegroundBorder',\n+ borderColor: 'panelForegroundBorder',\nborderRadius: 1,\nborderStyle: 'dashed',\nborderWidth: 1,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Tweak `ThreadSettingsDescription` style Summary: Here's what it looks like: https://blob.sh/atul/d220.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1674
129,184
12.07.2021 15:57:05
14,400
9dd835eecd3c1ddeb6a42649ba506178546527de
[native] Use `SWMansionIcon` for `ThreadIcon`s Summary: Here's how it looks like in various usages: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/settings/compose-subthread-modal.react.js", "new_path": "native/chat/settings/compose-subthread-modal.react.js", "diff": "import * as React from 'react';\nimport { Text } from 'react-native';\nimport IonIcon from 'react-native-vector-icons/Ionicons';\n-import Icon from 'react-native-vector-icons/MaterialIcons';\nimport { threadTypeDescriptions } from 'lib/shared/thread-utils';\nimport { type ThreadInfo, threadTypes } from 'lib/types/thread-types';\nimport Button from '../../components/button.react';\nimport Modal from '../../components/modal.react';\n+import SWMansionIcon from '../../components/swmansion-icon.react';\nimport type { RootNavigationProp } from '../../navigation/root-navigator.react';\nimport type { NavigationRoute } from '../../navigation/route-names';\nimport { ComposeThreadRouteName } from '../../navigation/route-names';\n@@ -35,8 +35,8 @@ class ComposeSubthreadModal extends React.PureComponent<Props> {\n<Modal modalStyle={this.props.styles.modal}>\n<Text style={this.props.styles.visibility}>Thread type</Text>\n<Button style={this.props.styles.option} onPress={this.onPressOpen}>\n- <Icon\n- name=\"public\"\n+ <SWMansionIcon\n+ name=\"globe-1\"\nsize={32}\nstyle={this.props.styles.visibilityIcon}\n/>\n@@ -51,8 +51,8 @@ class ComposeSubthreadModal extends React.PureComponent<Props> {\n/>\n</Button>\n<Button style={this.props.styles.option} onPress={this.onPressSecret}>\n- <Icon\n- name=\"lock-outline\"\n+ <SWMansionIcon\n+ name=\"lock-on\"\nsize={32}\nstyle={this.props.styles.visibilityIcon}\n/>\n@@ -101,7 +101,7 @@ class ComposeSubthreadModal extends React.PureComponent<Props> {\nconst unboundStyles = {\nforwardIcon: {\n- color: 'link',\n+ color: 'modalForegroundSecondaryLabel',\npaddingLeft: 10,\n},\nmodal: {\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-icon.react.js", "new_path": "native/components/thread-icon.react.js", "diff": "import * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport EntypoIcon from 'react-native-vector-icons/Entypo';\n-import MaterialIcon from 'react-native-vector-icons/MaterialIcons';\nimport { threadTypes, type ThreadType } from 'lib/types/thread-types';\n+import SWMansionIcon from './swmansion-icon.react';\n+\ntype Props = {|\n+threadType: ThreadType,\n+color: string,\n@@ -17,9 +18,7 @@ function ThreadIcon(props: Props) {\nthreadType === threadTypes.COMMUNITY_OPEN_SUBTHREAD ||\nthreadType === threadTypes.COMMUNITY_OPEN_ANNOUNCEMENT_SUBTHREAD\n) {\n- return <MaterialIcon name=\"public\" size={18} color={color} />;\n- } else if (threadType === threadTypes.PRIVATE) {\n- return <MaterialIcon name=\"lock\" size={18} color={color} />;\n+ return <SWMansionIcon name=\"globe-1\" size={18} color={color} />;\n} else if (threadType === threadTypes.SIDEBAR) {\nreturn (\n<EntypoIcon\n@@ -30,9 +29,9 @@ function ThreadIcon(props: Props) {\n/>\n);\n} else if (threadType === threadTypes.PERSONAL) {\n- return <MaterialIcon name=\"people\" size={18} color={color} />;\n+ return <SWMansionIcon name=\"users\" size={18} color={color} />;\n} else {\n- return <MaterialIcon name=\"lock-outline\" size={18} color={color} />;\n+ return <SWMansionIcon name=\"lock-on\" size={18} color={color} />;\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use `SWMansionIcon` for `ThreadIcon`s Summary: Here's how it looks like in various usages: https://blob.sh/atul/75aa.png https://blob.sh/atul/48d2.png https://blob.sh/atul/5e6e.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1675
129,184
12.07.2021 16:28:21
14,400
7867621ed8d8570765e97c7aba84bd3e2aaa6482
[native] Use `threadInfo.color` as `selectionColor` for `ThreadSettingsName` and `ThreadSettingsDescription` Summary: Here's how it looks: Test Plan: Looks as expected (though will check w/ design team and possibly revert) Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-description.react.js", "new_path": "native/chat/settings/thread-settings-description.react.js", "diff": "@@ -100,6 +100,7 @@ class ThreadSettingsDescription extends React.PureComponent<Props> {\neditable={this.props.loadingStatus !== 'loading'}\nonContentSizeChange={this.onTextInputContentSizeChange}\nref={this.textInputRef}\n+ selectionColor={`#${this.props.threadInfo.color}`}\n/>\n{button}\n</View>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-name.react.js", "new_path": "native/chat/settings/thread-settings-name.react.js", "diff": "@@ -100,6 +100,7 @@ class ThreadSettingsName extends React.PureComponent<Props> {\nonBlur={this.onSubmit}\neditable={this.props.loadingStatus !== 'loading'}\nref={this.textInputRef}\n+ selectionColor={`#${this.props.threadInfo.color}`}\n/>\n{button}\n</React.Fragment>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use `threadInfo.color` as `selectionColor` for `ThreadSettingsName` and `ThreadSettingsDescription` Summary: Here's how it looks: https://blob.sh/atul/7336.png Test Plan: Looks as expected (though will check w/ design team and possibly revert) Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1676
129,184
12.07.2021 17:32:00
14,400
5b69534059c4c8fa2c1edf1372b660870e31616f
[native] Introduce `BackgroundTabIllustration` Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/background-chat-thread-list.react.js", "new_path": "native/chat/background-chat-thread-list.react.js", "diff": "// @flow\nimport * as React from 'react';\n-import { Text } from 'react-native';\n+import { Text, View } from 'react-native';\nimport { unreadBackgroundCount } from 'lib/selectors/thread-selectors';\nimport {\n@@ -9,6 +9,7 @@ import {\nemptyItemText,\n} from 'lib/shared/thread-utils';\n+import BackgroundTabIllustration from '../components/background-tab-illustration.react';\nimport type { NavigationRoute } from '../navigation/route-names';\nimport { useSelector } from '../redux/redux-utils';\nimport { useStyles } from '../themes/colors';\n@@ -51,14 +52,25 @@ export default function BackgroundChatThreadList(\nfunction EmptyItem() {\nconst styles = useStyles(unboundStyles);\n- return <Text style={styles.emptyList}>{emptyItemText}</Text>;\n+ return (\n+ <View>\n+ <View style={styles.container}>\n+ <BackgroundTabIllustration />\n+ </View>\n+ <Text style={styles.emptyList}>{emptyItemText}</Text>\n+ </View>\n+ );\n}\nconst unboundStyles = {\n+ container: {\n+ alignItems: 'center',\n+ paddingVertical: 40,\n+ },\nemptyList: {\ncolor: 'listBackgroundLabel',\n- fontSize: 17,\n- marginHorizontal: 15,\n+ fontSize: 14,\n+ marginHorizontal: 20,\nmarginVertical: 10,\ntextAlign: 'center',\n},\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/components/background-tab-illustration.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+import Svg, { Rect, Path, Circle } from 'react-native-svg';\n+\n+function BackgroundTabIllustration(): React.Node {\n+ return (\n+ <Svg\n+ width={133}\n+ height={100}\n+ viewBox=\"0 0 133 100\"\n+ fill=\"none\"\n+ xmlns=\"http://www.w3.org/2000/svg\"\n+ >\n+ <Rect\n+ x={20.5}\n+ y={32}\n+ width={87}\n+ height={67.522}\n+ rx={5.194}\n+ fill=\"#563894\"\n+ />\n+ <Path\n+ fillRule=\"evenodd\"\n+ clipRule=\"evenodd\"\n+ d=\"M63.115 63.61l-33.54-31.226a1.317 1.317 0 01-.288-.384h-3.593a5.19 5.19 0 00-1.69.281c.175 1.4.822 2.778 2.031 3.904l33.54 31.227a6.492 6.492 0 008.849 0l33.54-31.227c1.21-1.126 1.857-2.503 2.032-3.904a5.181 5.181 0 00-1.69-.281h-3.593a1.32 1.32 0 01-.288.384L64.885 63.61a1.299 1.299 0 01-1.77 0z\"\n+ fill=\"#331F5C\"\n+ />\n+ <Circle cx={99.5} cy={33} r={33} fill=\"#AE94DB\" />\n+ <Path\n+ d=\"M93.202 15.26a13.003 13.003 0 016.298-1.634c7.217 0 13.25 6.034 13.25 13.252 0 3.38.414 6.346.988 8.835M87.354 21.65a12.953 12.953 0 00-1.104 5.228c0 11.043-4.417 17.67-4.417 17.67h28.709M81.833 15.835l35.334 35.338\"\n+ stroke=\"#6D49AB\"\n+ strokeWidth={3.713}\n+ strokeLinecap=\"round\"\n+ strokeLinejoin=\"round\"\n+ />\n+ <Path\n+ d=\"M106.125 46.756a6.625 6.625 0 11-13.25 0\"\n+ stroke=\"#6D49AB\"\n+ strokeWidth={3.713}\n+ />\n+ </Svg>\n+ );\n+}\n+\n+export default BackgroundTabIllustration;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Introduce `BackgroundTabIllustration` Summary: Here's what it looks like: https://blob.sh/atul/3e9c.png Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1677
129,191
13.07.2021 11:37:13
-7,200
7688f3767cf278ff475fb0073e1460053afbe8df
[native] Rename multimedia tooltip modal Summary: Rename multimedia tooltip to multimedia message tooltip Test Plan: Open a multimedia message tooltip Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "RENAME", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-message-tooltip-button.react.js", "diff": "@@ -16,11 +16,11 @@ const { Value } = Animated;\nfunction noop() {}\ntype Props = {|\n- +navigation: AppNavigationProp<'MultimediaTooltipModal'>,\n- +route: TooltipRoute<'MultimediaTooltipModal'>,\n+ +navigation: AppNavigationProp<'MultimediaMessageTooltipModal'>,\n+ +route: TooltipRoute<'MultimediaMessageTooltipModal'>,\n+progress: Value,\n|};\n-function MultimediaTooltipButton(props: Props): React.Node {\n+function MultimediaMessageTooltipButton(props: Props): React.Node {\nconst windowWidth = useSelector((state) => state.dimensions.width);\nconst { progress } = props;\nconst { initialCoordinates } = props.route.params;\n@@ -54,4 +54,4 @@ function MultimediaTooltipButton(props: Props): React.Node {\n);\n}\n-export default React.memo<Props>(MultimediaTooltipButton);\n+export default React.memo<Props>(MultimediaMessageTooltipButton);\n" }, { "change_type": "RENAME", "old_path": "native/chat/multimedia-tooltip-modal.react.js", "new_path": "native/chat/multimedia-message-tooltip-modal.react.js", "diff": "@@ -6,11 +6,11 @@ import {\ntype TooltipParams,\n} from '../navigation/tooltip.react';\nimport type { VerticalBounds } from '../types/layout-types';\n+import MultimediaMessageTooltipButton from './multimedia-message-tooltip-button.react';\nimport type { ChatMultimediaMessageInfoItem } from './multimedia-message-utils';\n-import MultimediaTooltipButton from './multimedia-tooltip-button.react';\nimport { navigateToSidebar } from './sidebar-navigation';\n-export type MultimediaTooltipModalParams = TooltipParams<{|\n+export type MultimediaMessageTooltipModalParams = TooltipParams<{|\n+item: ChatMultimediaMessageInfoItem,\n+verticalBounds: VerticalBounds,\n|}>;\n@@ -30,11 +30,10 @@ const spec = {\n],\n};\n-const MultimediaTooltipModal = createTooltip<'MultimediaTooltipModal'>(\n- MultimediaTooltipButton,\n- spec,\n-);\n+const MultimediaMessageTooltipModal = createTooltip<\n+ 'MultimediaMessageTooltipModal',\n+>(MultimediaMessageTooltipButton, spec);\n-const multimediaTooltipHeight = tooltipHeight(spec.entries.length);\n+const multimediaMessageTooltipHeight = tooltipHeight(spec.entries.length);\n-export { MultimediaTooltipModal, multimediaTooltipHeight };\n+export { MultimediaMessageTooltipModal, multimediaMessageTooltipHeight };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -17,19 +17,19 @@ import { OverlayContext } from '../navigation/overlay-context';\nimport type { OverlayContextType } from '../navigation/overlay-context';\nimport {\nImageModalRouteName,\n- MultimediaTooltipModalRouteName,\n+ MultimediaMessageTooltipModalRouteName,\nVideoPlaybackModalRouteName,\n} from '../navigation/route-names';\nimport { type VerticalBounds } from '../types/layout-types';\nimport type { LayoutCoordinates } from '../types/layout-types';\nimport { ComposedMessage } from './composed-message.react';\nimport { InnerMultimediaMessage } from './inner-multimedia-message.react';\n+import { multimediaMessageTooltipHeight } from './multimedia-message-tooltip-modal.react';\nimport {\ntype ChatMultimediaMessageInfoItem,\ngetMediaKey,\nmultimediaMessageSendFailed,\n} from './multimedia-message-utils';\n-import { multimediaTooltipHeight } from './multimedia-tooltip-modal.react';\ntype BaseProps = {|\n...React.ElementConfig<typeof View>,\n@@ -132,10 +132,10 @@ class MultimediaMessage extends React.PureComponent<Props, State> {\nconst boundsBottom = verticalBounds.y + verticalBounds.height;\nconst belowMargin = 20;\n- const belowSpace = multimediaTooltipHeight + belowMargin;\n+ const belowSpace = multimediaMessageTooltipHeight + belowMargin;\nconst { isViewer } = item.messageInfo.creator;\nconst aboveMargin = isViewer ? 30 : 50;\n- const aboveSpace = multimediaTooltipHeight + aboveMargin;\n+ const aboveSpace = multimediaMessageTooltipHeight + aboveMargin;\nlet location = 'below',\nmargin = belowMargin;\n@@ -148,7 +148,7 @@ class MultimediaMessage extends React.PureComponent<Props, State> {\n}\nthis.props.navigation.navigate({\n- name: MultimediaTooltipModalRouteName,\n+ name: MultimediaMessageTooltipModalRouteName,\nparams: {\npresentedFrom: this.props.route.key,\nitem,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/sidebar-navigation.js", "new_path": "native/chat/sidebar-navigation.js", "diff": "@@ -12,14 +12,14 @@ function navigateToSidebar(\nroute:\n| TooltipRoute<'RobotextMessageTooltipModal'>\n| TooltipRoute<'TextMessageTooltipModal'>\n- | TooltipRoute<'MultimediaTooltipModal'>,\n+ | TooltipRoute<'MultimediaMessageTooltipModal'>,\ndispatchFunctions: DispatchFunctions,\nbindServerCall: <F>(serverCall: ActionFunc<F>) => F,\ninputState: ?InputState,\nnavigation:\n| AppNavigationProp<'RobotextMessageTooltipModal'>\n| AppNavigationProp<'TextMessageTooltipModal'>\n- | AppNavigationProp<'MultimediaTooltipModal'>,\n+ | AppNavigationProp<'MultimediaMessageTooltipModal'>,\nviewerID: ?string,\n) {\nconst threadInfo = getSidebarThreadInfo(route.params.item, viewerID);\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -11,7 +11,7 @@ import { unreadCount } from 'lib/selectors/thread-selectors';\nimport AppsDirectory from '../apps/apps-directory.react';\nimport Calendar from '../calendar/calendar.react';\nimport Chat from '../chat/chat.react';\n-import { MultimediaTooltipModal } from '../chat/multimedia-tooltip-modal.react';\n+import { MultimediaMessageTooltipModal } from '../chat/multimedia-message-tooltip-modal.react';\nimport { RobotextMessageTooltipModal } from '../chat/robotext-message-tooltip-modal.react';\nimport ThreadSettingsMemberTooltipModal from '../chat/settings/thread-settings-member-tooltip-modal.react';\nimport { TextMessageTooltipModal } from '../chat/text-message-tooltip-modal.react';\n@@ -37,7 +37,7 @@ import {\nProfileRouteName,\nTabNavigatorRouteName,\nImageModalRouteName,\n- MultimediaTooltipModalRouteName,\n+ MultimediaMessageTooltipModalRouteName,\nActionResultModalRouteName,\nTextMessageTooltipModalRouteName,\nThreadSettingsMemberTooltipModalRouteName,\n@@ -200,8 +200,8 @@ function AppNavigator(props: AppNavigatorProps) {\n<App.Screen name={TabNavigatorRouteName} component={TabNavigator} />\n<App.Screen name={ImageModalRouteName} component={ImageModal} />\n<App.Screen\n- name={MultimediaTooltipModalRouteName}\n- component={MultimediaTooltipModal}\n+ name={MultimediaMessageTooltipModalRouteName}\n+ component={MultimediaMessageTooltipModal}\n/>\n<App.Screen\nname={ActionResultModalRouteName}\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/route-names.js", "new_path": "native/navigation/route-names.js", "diff": "@@ -6,7 +6,7 @@ import type { ThreadPickerModalParams } from '../calendar/thread-picker-modal.re\nimport type { ComposeThreadParams } from '../chat/compose-thread.react';\nimport type { ImagePasteModalParams } from '../chat/image-paste-modal.react';\nimport type { MessageListParams } from '../chat/message-list-types';\n-import type { MultimediaTooltipModalParams } from '../chat/multimedia-tooltip-modal.react';\n+import type { MultimediaMessageTooltipModalParams } from '../chat/multimedia-message-tooltip-modal.react';\nimport type { RobotextMessageTooltipModalParams } from '../chat/robotext-message-tooltip-modal.react';\nimport type { AddUsersModalParams } from '../chat/settings/add-users-modal.react';\nimport type { ColorPickerModalParams } from '../chat/settings/color-picker-modal.react';\n@@ -52,7 +52,8 @@ export const CustomServerModalRouteName = 'CustomServerModal';\nexport const ColorPickerModalRouteName = 'ColorPickerModal';\nexport const ComposeSubthreadModalRouteName = 'ComposeSubthreadModal';\nexport const ImageModalRouteName = 'ImageModal';\n-export const MultimediaTooltipModalRouteName = 'MultimediaTooltipModal';\n+export const MultimediaMessageTooltipModalRouteName =\n+ 'MultimediaMessageTooltipModal';\nexport const ActionResultModalRouteName = 'ActionResultModal';\nexport const TextMessageTooltipModalRouteName = 'TextMessageTooltipModal';\nexport const ThreadSettingsMemberTooltipModalRouteName =\n@@ -79,7 +80,7 @@ export type RootParamList = {|\n|};\nexport type TooltipModalParamList = {|\n- +MultimediaTooltipModal: MultimediaTooltipModalParams,\n+ +MultimediaMessageTooltipModal: MultimediaMessageTooltipModalParams,\n+TextMessageTooltipModal: TextMessageTooltipModalParams,\n+ThreadSettingsMemberTooltipModal: ThreadSettingsMemberTooltipModalParams,\n+RelationshipListItemTooltipModal: RelationshipListItemTooltipModalParams,\n@@ -145,7 +146,7 @@ export const accountModals = [LoggedOutModalRouteName];\nexport const scrollBlockingModals = [\nImageModalRouteName,\n- MultimediaTooltipModalRouteName,\n+ MultimediaMessageTooltipModalRouteName,\nTextMessageTooltipModalRouteName,\nThreadSettingsMemberTooltipModalRouteName,\nRelationshipListItemTooltipModalRouteName,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Rename multimedia tooltip modal Summary: Rename multimedia tooltip to multimedia message tooltip Test Plan: Open a multimedia message tooltip Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1683
129,184
13.07.2021 11:48:39
14,400
c49a568e6be013f9dd910cdf1c24fbdbfd8f6720
[native] Apply `threadInfo.color` to chat input bar icons Summary: Here's what it looks like: Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -201,7 +201,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nconst expandoButtonsWidth = interpolate(expandoButtonsOpen, {\ninputRange: [0, 1],\n- outputRange: [22, 66],\n+ outputRange: [26, 66],\n});\nthis.expandoButtonsStyle = {\n...unboundStyles.expandoButtons,\n@@ -499,7 +499,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n<SWMansionIcon\nname=\"chevron-right\"\nsize={22}\n- color={this.props.colors.listInputButton}\n+ color={`#${this.props.threadInfo.color}`}\n/>\n</Animated.View>\n</TouchableOpacity>\n@@ -519,7 +519,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n<SWMansionIcon\nname=\"image-1\"\nsize={24}\n- color={this.props.colors.listInputButton}\n+ color={`#${this.props.threadInfo.color}`}\n/>\n</Animated.View>\n</TouchableOpacity>\n@@ -532,7 +532,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n<SWMansionIcon\nname=\"camera\"\nsize={24}\n- color={this.props.colors.listInputButton}\n+ color={`#${this.props.threadInfo.color}`}\n/>\n</Animated.View>\n</TouchableOpacity>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Apply `threadInfo.color` to chat input bar icons Summary: Here's what it looks like: https://blob.sh/atul/chatinputbarcolor.mp4 Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1684
129,184
14.07.2021 15:05:32
14,400
067d4822c170a5b5cdfd795a01b1a3ffb38bd4e2
[server] Resolve issue where empty array was being passed into `insertQuery` in `updateChangedUndirectedRelationships` Summary: na Test Plan: na Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "server/src/updaters/relationship-updaters.js", "new_path": "server/src/updaters/relationship-updaters.js", "diff": "@@ -255,7 +255,7 @@ async function updateUndirectedRelationships(\nasync function updateChangedUndirectedRelationships(\nchangeset: UndirectedRelationshipRow[],\n): Promise<UpdateData[]> {\n- if (!changeset.length) {\n+ if (changeset.length === 0) {\nreturn [];\n}\n@@ -283,6 +283,9 @@ async function updateChangedUndirectedRelationships(\ninsertRows.push([row.user1, row.user2, row.status]);\n}\n}\n+ if (insertRows.length === 0) {\n+ return [];\n+ }\nconst insertQuery = SQL`\nINSERT INTO relationships_undirected (user1, user2, status)\nVALUES ${insertRows}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Resolve issue where empty array was being passed into `insertQuery` in `updateChangedUndirectedRelationships` Summary: na Test Plan: na Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1693
129,184
13.07.2021 20:07:11
14,400
60aeb682f59c545257d192fa4c6cc6d3c8bafe56
[native] Add `SDWebImage` dependency to `@react-native-community/clipboard` Test Plan: Was able to use `SDWebImage` dependency as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -396,6 +396,7 @@ PODS:\n- React\n- RNCClipboard (1.5.1):\n- React-Core\n+ - SDWebImage (~> 5.8)\n- RNCMaskedView (0.1.10):\n- React\n- RNDeviceInfo (8.0.7):\n@@ -789,7 +790,7 @@ SPEC CHECKSUMS:\nReactNativeKeyboardInput: 266ba27a2e9921f5bdc0b4cc30289b2a2f46b157\nReactNativeKeyboardTrackingView: 02137fac3b2ebd330d74fa54ead48b14750a2306\nRNCAsyncStorage: 60a80e72d95bf02a01cace55d3697d9724f0d77f\n- RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495\n+ RNCClipboard: f470a4445c779f99c10201b038ab3f9e24e71dbc\nRNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f\nRNDeviceInfo: 55463fa6e252ca3f0e2ba6001a7b82f879914338\nRNExitApp: c4e052df2568b43bec8a37c7cd61194d4cfee2c3\n" }, { "change_type": "MODIFY", "old_path": "patches/@react-native-community+clipboard+1.5.1.patch", "new_path": "patches/@react-native-community+clipboard+1.5.1.patch", "diff": "+diff --git a/node_modules/@react-native-community/clipboard/RNCClipboard.podspec b/node_modules/@react-native-community/clipboard/RNCClipboard.podspec\n+index 095b496..b19b07f 100644\n+--- a/node_modules/@react-native-community/clipboard/RNCClipboard.podspec\n++++ b/node_modules/@react-native-community/clipboard/RNCClipboard.podspec\n+@@ -17,4 +17,6 @@ Pod::Spec.new do |s|\n+ s.osx.source_files = \"macos/**/*.{h,m,mm}\"\n+\n+ s.dependency 'React-Core'\n++ s.dependency 'SDWebImage', '~> 5.8'\n++\n+ end\ndiff --git a/node_modules/@react-native-community/clipboard/dist/Clipboard.d.ts b/node_modules/@react-native-community/clipboard/dist/Clipboard.d.ts\nindex af27802..bb0cc9c 100644\n--- a/node_modules/@react-native-community/clipboard/dist/Clipboard.d.ts\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add `SDWebImage` dependency to `@react-native-community/clipboard` Test Plan: Was able to use `SDWebImage` dependency as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1689
129,184
13.07.2021 20:29:24
14,400
1add786fa360dfdd33277a817dabef3d24780e9b
[native] Introduce `setImageFromURL` Test Plan: Was able to paste images added to `NSPasteboard` via `setImageFromURL` Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "patches/@react-native-community+clipboard+1.5.1.patch", "new_path": "patches/@react-native-community+clipboard+1.5.1.patch", "diff": "@@ -9,80 +9,11 @@ index 095b496..b19b07f 100644\n+ s.dependency 'SDWebImage', '~> 5.8'\n+\nend\n-diff --git a/node_modules/@react-native-community/clipboard/dist/Clipboard.d.ts b/node_modules/@react-native-community/clipboard/dist/Clipboard.d.ts\n-index af27802..bb0cc9c 100644\n---- a/node_modules/@react-native-community/clipboard/dist/Clipboard.d.ts\n-+++ b/node_modules/@react-native-community/clipboard/dist/Clipboard.d.ts\n-@@ -21,6 +21,64 @@ export declare const Clipboard: {\n- * @param the content to be stored in the clipboard.\n- */\n- setString(content: string): void;\n-+ /**\n-+ * (IOS Only)\n-+ * Set clipboard image from Base64 image representation.\n-+ * You can use following code to set clipboard content\n-+ * ```javascript\n-+ * _setContent() {\n-+ * Clipboard.setImageFromBase64('data:image/png;base64,....');\n-+ * }\n-+ * ```\n-+ * @param the image to be stored in the clipboard.\n-+ */\n-+ setImageFromBase64(image: string): void;\n-+ /**\n-+ * (IOS Only)\n-+ * Get PNG image from clipboard in Base64.\n-+ * This method returns a `Promise`, so you can use following code to get clipboard content:\n-+ * ```javascript\n-+ * async _getContent() {\n-+ * var content = await Clipboard.getPNGImageData();\n-+ * }\n-+ * ```\n-+ */\n-+ getPNGImageData(): Promise<string>;\n-+ /**\n-+ * (IOS Only)\n-+ * Get JPG image from clipboard in Base64.\n-+ * This method returns a `Promise`, so you can use following code to get clipboard content:\n-+ * ```javascript\n-+ * async _getContent() {\n-+ * var content = await Clipboard.getJPGImageData();\n-+ * }\n-+ * ```\n-+ */\n-+ getJPGImageData(): Promise<string>;\n-+ /**\n-+ * (IOS Only)\n-+ * Get clipboard image data of unknown type.\n-+ * The image format can't be determined by MIME-type, but can be found via magic numbers.\n-+ * This method returns a `Promise`, so you can use following code to get clipboard content:\n-+ * ```javascript\n-+ * async _getContent() {\n-+ * var content = await Clipboard.getImageData();\n-+ * }\n-+ * ```\n-+ */\n-+ getImageData(): Promise<string>;\n-+ /**\n-+ * (IOS Only)\n-+ * Get filepath (in tmp directory) of clipboard image.\n-+ * The image format can't be determined by MIME-type or extension, but can via magic numbers.\n-+ * This method returns a `Promise`, so you can use following code to get clipboard content:\n-+ * ```javascript\n-+ * async _getContent() {\n-+ * var content = await Clipboard.getImageFilePath();\n-+ * }\n-+ * ```\n-+ */\n-+ getImageFilePath(): Promise<string>;\n- /**\n- * Returns whether the clipboard has content or is empty.\n- * This method returns a `Promise`, so you can use following code to get clipboard content\ndiff --git a/node_modules/@react-native-community/clipboard/dist/Clipboard.js b/node_modules/@react-native-community/clipboard/dist/Clipboard.js\n-index c0c652d..38077b6 100644\n+index c0c652d..20ef163 100644\n--- a/node_modules/@react-native-community/clipboard/dist/Clipboard.js\n+++ b/node_modules/@react-native-community/clipboard/dist/Clipboard.js\n-@@ -32,6 +32,74 @@ exports.Clipboard = {\n+@@ -32,6 +32,83 @@ exports.Clipboard = {\nsetString: function (content) {\nNativeClipboard_1.default.setString(content);\n},\n@@ -95,13 +26,22 @@ index c0c652d..38077b6 100644\n+ * Clipboard.setImageFromBase64('data:image/png;base64,....');\n+ * }\n+ * ```\n-+ * @param the image to be stored in the clipboard.\n++ * @param image the image to be stored in the clipboard.\n+ */\n+ setImageFromBase64: function (image) {\n+ NativeClipboard_1.default.setImageFromBase64(image);\n+ },\n+ /**\n+ * (IOS Only)\n++ * Set clipboard image from URL.\n++ * @param image the image to be stored in the clipboard.\n++ * @param callback fn to handle success boolean\n++ */\n++ setImageFromURL: function (url, callback) {\n++ NativeClipboard_1.default.setImageFromURL(url, callback);\n++ },\n++ /**\n++ * (IOS Only)\n+ * Get PNG image from clipboard in Base64.\n+ * This method returns a `Promise`, so you can use following code to get clipboard content:\n+ * ```javascript\n@@ -158,10 +98,10 @@ index c0c652d..38077b6 100644\n* Returns whether the clipboard has content or is empty.\n* This method returns a `Promise`, so you can use following code to get clipboard content\ndiff --git a/node_modules/@react-native-community/clipboard/ios/RNCClipboard.m b/node_modules/@react-native-community/clipboard/ios/RNCClipboard.m\n-index 3b848c2..9b7cee9 100644\n+index 3b848c2..4d50dba 100644\n--- a/node_modules/@react-native-community/clipboard/ios/RNCClipboard.m\n+++ b/node_modules/@react-native-community/clipboard/ios/RNCClipboard.m\n-@@ -1,6 +1,7 @@\n+@@ -1,9 +1,11 @@\n#import \"RNCClipboard.h\"\n@@ -169,7 +109,11 @@ index 3b848c2..9b7cee9 100644\n#import <UIKit/UIKit.h>\n#import <React/RCTBridge.h>\n#import <React/RCTEventDispatcher.h>\n-@@ -28,6 +29,83 @@ - (dispatch_queue_t)methodQueue\n++#import <SDWebImage/SDWebImageManager.h>\n+\n+\n+ @implementation RNCClipboard\n+@@ -28,6 +30,100 @@ - (dispatch_queue_t)methodQueue\nresolve((clipboard.string ? : @\"\"));\n}\n@@ -193,6 +137,23 @@ index 3b848c2..9b7cee9 100644\n+ clipboard.image = (uiImage ?: NULL);\n+}\n+\n++\n++RCT_EXPORT_METHOD(setImageFromURL: (NSString *)url\n++ success:(RCTResponseSenderBlock)success)\n++{\n++ [SDWebImageManager.sharedManager loadImageWithURL:[NSURL URLWithString: url] options:0 progress:NULL completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {\n++\n++ if (error || !finished) {\n++ success(@[@NO]);\n++ return;\n++ }\n++\n++ UIPasteboard *clipboard = [UIPasteboard generalPasteboard];\n++ clipboard.image = image;\n++ success(@[@YES]);\n++ }];\n++}\n++\n+RCT_EXPORT_METHOD(getPNGImageData : (RCTPromiseResolveBlock)resolve reject : (__unused RCTPromiseRejectBlock)reject)\n+{\n+ NSString *pngPrefix = @\"data:image/png;base64,\";\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Introduce `setImageFromURL` Test Plan: Was able to paste images added to `NSPasteboard` via `setImageFromURL` Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1690
129,184
14.07.2021 13:17:50
14,400
8bda052c6b534dc2f3bdeaff25b33fd811f46407
[native] Add copy image functionality to `ImageModal` on iOS Summary: Here's how it looks: Test Plan: Tested on iPhone 12 Pro where it worked as expected. Tested on android emulator where the "copy button" didn't show up (as expected) Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/media/image-modal.react.js", "new_path": "native/media/image-modal.react.js", "diff": "// @flow\n+import Clipboard from '@react-native-community/clipboard';\nimport invariant from 'invariant';\nimport * as React from 'react';\nimport {\n@@ -24,6 +25,7 @@ import { useIsReportEnabled } from 'lib/utils/report-utils';\nimport type { ChatMultimediaMessageInfoItem } from '../chat/multimedia-message-utils';\nimport SWMansionIcon from '../components/swmansion-icon.react';\nimport ConnectedStatusBar from '../connected-status-bar.react';\n+import { displayActionResultModal } from '../navigation/action-result-modal';\nimport type { AppNavigationProp } from '../navigation/app-navigator.react';\nimport {\nOverlayContext,\n@@ -1028,6 +1030,21 @@ class ImageModal extends React.PureComponent<Props, State> {\nopacity: this.actionLinksOpacity,\nbottom: this.props.dimensions.bottomInset + 8,\n};\n+\n+ let copyButton;\n+ if (Platform.OS === 'ios') {\n+ copyButton = (\n+ <TouchableOpacity\n+ onPress={this.copy}\n+ disabled={!this.state.actionLinksEnabled}\n+ style={styles.mediaIconButtons}\n+ >\n+ <SWMansionIcon name=\"copy\" style={styles.mediaIcon} />\n+ <Text style={styles.mediaIconText}>Copy</Text>\n+ </TouchableOpacity>\n+ );\n+ }\n+\nconst view = (\n<Animated.View style={styles.container}>\n{statusBar}\n@@ -1050,7 +1067,11 @@ class ImageModal extends React.PureComponent<Props, State> {\n<Animated.View\nstyle={[styles.mediaIconsContainer, mediaIconsButtonStyle]}\n>\n- <View onLayout={this.onMediaIconsLayout} ref={this.mediaIconsRef}>\n+ <View\n+ style={styles.mediaIconsRow}\n+ onLayout={this.onMediaIconsLayout}\n+ ref={this.mediaIconsRef}\n+ >\n<TouchableOpacity\nonPress={this.save}\ndisabled={!this.state.actionLinksEnabled}\n@@ -1059,6 +1080,7 @@ class ImageModal extends React.PureComponent<Props, State> {\n<SWMansionIcon name=\"save\" style={styles.mediaIcon} />\n<Text style={styles.mediaIconText}>Save</Text>\n</TouchableOpacity>\n+ {copyButton}\n</View>\n</Animated.View>\n</Animated.View>\n@@ -1119,6 +1141,13 @@ class ImageModal extends React.PureComponent<Props, State> {\n});\n};\n+ copy = () => {\n+ const { uri } = this.props.route.params.mediaInfo;\n+ Clipboard.setImageFromURL(uri, (success) => {\n+ displayActionResultModal(success ? 'copied!' : 'failed to copy :(');\n+ });\n+ };\n+\nsetCloseButtonEnabled = ([enabledNum]: [number]) => {\nconst enabled = !!enabledNum;\nif (this.state.closeButtonEnabled !== enabled) {\n@@ -1225,6 +1254,9 @@ const styles = StyleSheet.create({\nleft: 16,\nposition: 'absolute',\n},\n+ mediaIconsRow: {\n+ flexDirection: 'row',\n+ },\n});\nexport default React.memo<BaseProps>(function ConnectedImageModal(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add copy image functionality to `ImageModal` on iOS Summary: Here's how it looks: https://blob.sh/atul/4592.png Test Plan: Tested on iPhone 12 Pro where it worked as expected. Tested on android emulator where the "copy button" didn't show up (as expected) Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1692
129,184
14.07.2021 16:26:50
14,400
f3c7c4b6071e3d7ddd645e02db8cc84b52c52845
[native] Change "Threads" -> "Inbox" in top tab bar and "Chat" -> "Inbox" in bottom tab bar Summary: na Test Plan: Looks as expected Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -183,7 +183,7 @@ const header = (props: CoreStackHeaderProps) => {\nconst headerBackButton = (props) => <HeaderBackButton {...props} />;\nconst chatThreadListOptions = ({ navigation }) => ({\n- headerTitle: 'Threads',\n+ headerTitle: 'Inbox',\nheaderRight:\nPlatform.OS === 'ios'\n? () => <ComposeThreadButton navigate={navigation.navigate} />\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -62,7 +62,7 @@ const calendarTabOptions = {\n),\n};\nconst getChatTabOptions = (badge: number) => ({\n- tabBarLabel: 'Chat',\n+ tabBarLabel: 'Inbox',\n// eslint-disable-next-line react/display-name\ntabBarIcon: ({ color }) => (\n<SWMansionIcon name=\"message-square\" style={[styles.icon, { color }]} />\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Change "Threads" -> "Inbox" in top tab bar and "Chat" -> "Inbox" in bottom tab bar Summary: na Test Plan: Looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1694
129,187
14.07.2021 23:09:16
14,400
e5f7094a8844af2c70991681f36c46efb525ce84
[native] codeVersion -> 91
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -282,8 +282,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 90\n- versionName '0.0.90'\n+ versionCode 91\n+ versionName '0.0.91'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.90</string>\n+ <string>0.0.91</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>90</string>\n+ <string>91</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.90</string>\n+ <string>0.0.91</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>90</string>\n+ <string>91</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -280,7 +280,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 90;\n+const codeVersion = 91;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 91
129,187
21.03.2021 23:02:13
14,400
f5ad72eb3ae1ae48aa15e7854bb977db5121bbf4
RN0.64 3/*: Update Flow Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "landing/.flowconfig", "new_path": "landing/.flowconfig", "diff": "@@ -9,6 +9,8 @@ module.name_mapper.extension='css' -> '<PROJECT_ROOT>/flow/CSSModule.js.flow'\nesproposal.optional_chaining=enable\nesproposal.nullish_coalescing=enable\n+exact_by_default=true\n+\n[lints]\nsketchy-null-number=warn\nsketchy-null-mixed=warn\n@@ -19,7 +21,6 @@ deprecated-type=warn\nunsafe-getters-setters=warn\nunnecessary-invariant=warn\nsignature-verification-failure=warn\n-deprecated-utility=error\n[strict]\ndeprecated-type\n" }, { "change_type": "MODIFY", "old_path": "landing/package.json", "new_path": "landing/package.json", "diff": "\"clean-webpack-plugin\": \"^3.0.0\",\n\"concurrently\": \"^5.3.0\",\n\"css-loader\": \"^4.3.0\",\n- \"flow-bin\": \"^0.122.0\",\n+ \"flow-bin\": \"^0.137.0\",\n\"flow-typed\": \"^3.2.1\",\n\"mini-css-extract-plugin\": \"^0.11.2\",\n\"optimize-css-assets-webpack-plugin\": \"^5.0.3\",\n" }, { "change_type": "MODIFY", "old_path": "lib/.flowconfig", "new_path": "lib/.flowconfig", "diff": "esproposal.optional_chaining=enable\nesproposal.nullish_coalescing=enable\n+exact_by_default=true\n+\n[lints]\nsketchy-null-number=warn\nsketchy-null-mixed=warn\n@@ -18,7 +20,6 @@ deprecated-type=warn\nunsafe-getters-setters=warn\nunnecessary-invariant=warn\nsignature-verification-failure=warn\n-deprecated-utility=error\n[strict]\ndeprecated-type\n" }, { "change_type": "MODIFY", "old_path": "lib/package.json", "new_path": "lib/package.json", "diff": "\"@babel/plugin-transform-runtime\": \"^7.13.10\",\n\"@babel/preset-flow\": \"^7.13.13\",\n\"@babel/preset-react\": \"^7.13.13\",\n- \"flow-bin\": \"^0.122.0\",\n+ \"flow-bin\": \"^0.137.0\",\n\"flow-typed\": \"^3.2.1\"\n},\n\"dependencies\": {\n" }, { "change_type": "MODIFY", "old_path": "native/.flowconfig", "new_path": "native/.flowconfig", "diff": "@@ -33,6 +33,8 @@ emoji=true\nesproposal.optional_chaining=enable\nesproposal.nullish_coalescing=enable\n+exact_by_default=true\n+\nmodule.file_ext=.js\nmodule.file_ext=.json\nmodule.file_ext=.ios.js\n@@ -47,10 +49,6 @@ suppress_type=$FlowFixMe\nsuppress_type=$FlowFixMeProps\nsuppress_type=$FlowFixMeState\n-suppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowFixMe\\\\($\\\\|[^(]\\\\|(\\\\(<VERSION>\\\\)? *\\\\(site=[a-z,_]*react_native\\\\(_ios\\\\)?_\\\\(oss\\\\|fb\\\\)[a-z,_]*\\\\)?)\\\\)\n-suppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowIssue\\\\((\\\\(<VERSION>\\\\)? *\\\\(site=[a-z,_]*react_native\\\\(_ios\\\\)?_\\\\(oss\\\\|fb\\\\)[a-z,_]*\\\\)?)\\\\)?:? #[0-9]+\n-suppress_comment=\\\\(.\\\\|\\n\\\\)*\\\\$FlowExpectedError\n-\n[lints]\nsketchy-null-number=warn\nsketchy-null-mixed=warn\n@@ -61,7 +59,6 @@ deprecated-type=warn\nunsafe-getters-setters=warn\nunnecessary-invariant=warn\nsignature-verification-failure=warn\n-deprecated-utility=error\n[strict]\ndeprecated-type\n@@ -73,4 +70,4 @@ untyped-import\nuntyped-type-import\n[version]\n-^0.122.0\n+^0.137.0\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"babel-plugin-transform-remove-console\": \"^6.9.4\",\n\"babel-plugin-transform-remove-strict-mode\": \"0.0.2\",\n\"comm-react-native-codegen\": \"npm:react-native-codegen@0.0.7\",\n- \"flow-bin\": \"^0.122.0\",\n+ \"flow-bin\": \"^0.137.0\",\n\"flow-mono-cli\": \"^1.5.0\",\n\"flow-typed\": \"^3.2.1\",\n\"fs-extra\": \"^8.1.0\",\n" }, { "change_type": "MODIFY", "old_path": "server/.flowconfig", "new_path": "server/.flowconfig", "diff": "@@ -19,6 +19,8 @@ module.file_ext=.json\nesproposal.optional_chaining=enable\nesproposal.nullish_coalescing=enable\n+exact_by_default=true\n+\n[lints]\nsketchy-null-number=warn\nsketchy-null-mixed=warn\n@@ -29,7 +31,6 @@ deprecated-type=warn\nunsafe-getters-setters=warn\nunnecessary-invariant=warn\nsignature-verification-failure=warn\n-deprecated-utility=error\n[strict]\ndeprecated-type\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"babel-jest\": \"^26.6.3\",\n\"chokidar-cli\": \"^2.1.0\",\n\"concurrently\": \"^5.3.0\",\n- \"flow-bin\": \"^0.122.0\",\n+ \"flow-bin\": \"^0.137.0\",\n\"flow-typed\": \"^3.2.1\",\n\"jest\": \"^26.6.3\",\n\"nodemon\": \"^2.0.4\"\n" }, { "change_type": "MODIFY", "old_path": "web/.flowconfig", "new_path": "web/.flowconfig", "diff": "@@ -9,6 +9,8 @@ module.name_mapper.extension='css' -> '<PROJECT_ROOT>/flow/CSSModule.js.flow'\nesproposal.optional_chaining=enable\nesproposal.nullish_coalescing=enable\n+exact_by_default=true\n+\n[lints]\nsketchy-null-number=warn\nsketchy-null-mixed=warn\n@@ -19,7 +21,6 @@ deprecated-type=warn\nunsafe-getters-setters=warn\nunnecessary-invariant=warn\nsignature-verification-failure=warn\n-deprecated-utility=error\n[strict]\ndeprecated-type\n" }, { "change_type": "MODIFY", "old_path": "web/package.json", "new_path": "web/package.json", "diff": "\"clean-webpack-plugin\": \"^3.0.0\",\n\"concurrently\": \"^5.3.0\",\n\"css-loader\": \"^4.3.0\",\n- \"flow-bin\": \"^0.122.0\",\n+ \"flow-bin\": \"^0.137.0\",\n\"flow-typed\": \"^3.2.1\",\n\"mini-css-extract-plugin\": \"^0.11.2\",\n\"optimize-css-assets-webpack-plugin\": \"^5.0.3\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -8046,10 +8046,10 @@ fleximap@^1.0.0:\nresolved \"https://registry.yarnpkg.com/fleximap/-/fleximap-1.0.0.tgz#1ad448de87b8e023ba6a60623b7e8b0867360ef6\"\nintegrity sha512-zg/PthjBzESYKomTw/wivo8Id6B+obVkWriIzDuRfuw4wxEIV2/0D/NIGf+LKcGTTifHRfw73+oAAQozZ9MAhA==\n-flow-bin@^0.122.0:\n- version \"0.122.0\"\n- resolved \"https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.122.0.tgz#c723a2b33b1a70bd10204704ae1dc776d5d89d79\"\n- integrity sha512-my8N5jgl/A+UVby9E7NDppHdhLgRbWgKbmFZSx2MSYMRh3d9YGnM2MM+wexpUpl0ftY1IM6ZcUwaAhrypLyvlA==\n+flow-bin@^0.137.0:\n+ version \"0.137.0\"\n+ resolved \"https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.137.0.tgz#322a15b3744195af1e02bf1fec0a716296aee7d5\"\n+ integrity sha512-ytwUn68fPKK/VWVpCxJ4KNeNIjCC/uX0Ll6Z1E98sOXfMknB000WtgQjKYDdO6tOR8mvXBE0adzjgCrChVympw==\nflow-mono-cli@^1.5.0:\nversion \"1.5.3\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 3/*: Update Flow Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1699
129,187
21.03.2021 23:32:21
14,400
f715fce54f9a82a0a78f9429de066ed3e6e35a7c
RN0.64 6/*: Miscellaneous config file changes Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": ".eslintrc.json", "new_path": ".eslintrc.json", "diff": "\"plugin:import/errors\",\n\"plugin:import/warnings\",\n\"plugin:prettier/recommended\",\n- \"prettier/react\",\n- \"prettier/flowtype\"\n+ \"prettier\"\n],\n\"parser\": \"babel-eslint\",\n\"plugins\": [\"react\", \"react-hooks\", \"flowtype\", \"monorepo\", \"import\"],\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/.editorconfig", "diff": "+# Windows files\n+[*.bat]\n+end_of_line = crlf\n" }, { "change_type": "MODIFY", "old_path": "native/.gitattributes", "new_path": "native/.gitattributes", "diff": "-*.pbxproj -text\n-\n-# specific for windows script files\n+# Windows files should use crlf line endings\n+# https://help.github.com/articles/dealing-with-line-endings/\n*.bat text eol=crlf\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 6/*: Miscellaneous config file changes Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1702
129,187
21.03.2021 23:41:58
14,400
ad2e64cd1b7387367935fd09a8c18a10ec7cd69d
RN0.64 7/*: Android updates Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/android/app/CMakeLists.txt", "new_path": "native/android/app/CMakeLists.txt", "diff": "@@ -59,9 +59,9 @@ add_library(\n# Provides a relative path to your source file(s).\n../../node_modules/react-native/ReactCommon/jsi/jsi/jsi.cpp\n../../node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/CallInvokerHolder.cpp\n- ../../node_modules/react-native/ReactCommon/turbomodule/core/TurboModule.cpp\n- ../../node_modules/react-native/ReactCommon/turbomodule/core/LongLivedObject.cpp\n- ../../node_modules/react-native/ReactCommon/turbomodule/core/TurboModuleUtils.cpp\n+ ../../node_modules/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.cpp\n+ ../../node_modules/react-native/ReactCommon/react/nativemodule/core/ReactCommon/LongLivedObject.cpp\n+ ../../node_modules/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.cpp\n${SQLITE}\n# folly\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -271,6 +271,8 @@ android {\nimplementation 'com.facebook.fbjni:fbjni:0.1.0'\n}\n+ ndkVersion rootProject.ext.ndkVersion\n+\ncompileSdkVersion rootProject.ext.compileSdkVersion\ncompileOptions {\n@@ -352,11 +354,12 @@ android {\nvariant.outputs.each { output ->\n// For each separate APK per architecture, set a unique version code as described here:\n// https://developer.android.com/studio/build/configure-apk-splits.html\n+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.\ndef versionCodes = [\"armeabi-v7a\": 1, \"x86\": 2, \"arm64-v8a\": 3, \"x86_64\": 4]\ndef abi = output.getFilter(OutputFile.ABI)\nif (abi != null) { // null for the universal-debug, universal-release variants\noutput.versionCodeOverride =\n- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/debug/AndroidManifest.xml", "new_path": "native/android/app/src/debug/AndroidManifest.xml", "diff": ">\n<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\n- <application android:usesCleartextTraffic=\"true\" tools:targetApi=\"28\" tools:ignore=\"GoogleAppIndexingWarning\" />\n+ <application\n+ android:usesCleartextTraffic=\"true\"\n+ tools:targetApi=\"28\"\n+ tools:ignore=\"GoogleAppIndexingWarning\">\n+ <activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\" />\n+ </application>\n</manifest>\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/main/AndroidManifest.xml", "new_path": "native/android/app/src/main/AndroidManifest.xml", "diff": "<category android:name=\"android.intent.category.LAUNCHER\" />\n</intent-filter>\n</activity>\n- <activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\" />\n<meta-data\nandroid:name=\"com.google.firebase.messaging.default_notification_icon\"\nandroid:resource=\"@drawable/notif_icon\"\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/main/res/values/styles.xml", "new_path": "native/android/app/src/main/res/values/styles.xml", "diff": "<resources>\n- <style name=\"AppThemeBase\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n+ <style name=\"AppThemeBase\" parent=\"Theme.AppCompat.DayNight.NoActionBar\">\n<item name=\"android:editTextBackground\">@android:color/transparent</item>\n</style>\n<style name=\"AppTheme\" parent=\"AppThemeBase\">\n</style>\n- <style name=\"SplashThemeBase\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n+ <style name=\"SplashThemeBase\" parent=\"Theme.AppCompat.DayNight.NoActionBar\">\n<item name=\"android:windowNoTitle\">true</item>\n<item name=\"android:windowDrawsSystemBarBackgrounds\">false</item>\n</style>\n" }, { "change_type": "MODIFY", "old_path": "native/android/build.gradle", "new_path": "native/android/build.gradle", "diff": "buildscript {\next {\n- buildToolsVersion = \"29.0.2\"\n+ buildToolsVersion = \"29.0.3\"\nminSdkVersion = 21\ncompileSdkVersion = 29\ntargetSdkVersion = 29\n+ ndkVersion = \"20.1.5948944\"\n}\nrepositories {\ngoogle()\n" }, { "change_type": "MODIFY", "old_path": "native/android/gradle/wrapper/gradle-wrapper.jar", "new_path": "native/android/gradle/wrapper/gradle-wrapper.jar", "diff": "Binary files a/native/android/gradle/wrapper/gradle-wrapper.jar and b/native/android/gradle/wrapper/gradle-wrapper.jar differ\n" }, { "change_type": "MODIFY", "old_path": "native/android/gradlew", "new_path": "native/android/gradlew", "diff": "@@ -82,6 +82,7 @@ esac\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n+\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\nif [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n@@ -129,6 +130,7 @@ fi\nif [ \"$cygwin\" = \"true\" -o \"$msys\" = \"true\" ] ; then\nAPP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\nCLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n+\nJAVACMD=`cygpath --unix \"$JAVACMD\"`\n# We build the pattern for arguments to be converted via cygpath\n" }, { "change_type": "MODIFY", "old_path": "native/android/gradlew.bat", "new_path": "native/android/gradlew.bat", "diff": "@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\n-if \"%ERRORLEVEL%\" == \"0\" goto init\n+if \"%ERRORLEVEL%\" == \"0\" goto execute\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n@@ -54,7 +54,7 @@ goto fail\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n-if exist \"%JAVA_EXE%\" goto init\n+if exist \"%JAVA_EXE%\" goto execute\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\n@@ -64,28 +64,14 @@ echo location of your Java installation.\ngoto fail\n-:init\n-@rem Get command-line arguments, handling Windows variants\n-\n-if not \"%OS%\" == \"Windows_NT\" goto win9xME_args\n-\n-:win9xME_args\n-@rem Slurp the command line arguments.\n-set CMD_LINE_ARGS=\n-set _SKIP=2\n-\n-:win9xME_args_slurp\n-if \"x%~1\" == \"x\" goto execute\n-\n-set CMD_LINE_ARGS=%*\n-\n:execute\n@rem Setup the command line\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n+\n@rem Execute Gradle\n-\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n+\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\n:end\n@rem End local scope for the variables with windows NT shell\n" }, { "change_type": "MODIFY", "old_path": "native/android/headers/ReactCommon", "new_path": "native/android/headers/ReactCommon", "diff": "-../../../node_modules/react-native/ReactCommon/turbomodule/core\n\\ No newline at end of file\n+../../../node_modules/react-native/ReactCommon/react/nativemodule/core/ReactCommon\n\\ No newline at end of file\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 7/*: Android updates Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1703
129,187
21.03.2021 23:47:34
14,400
a9e8c01ee1a5dde4c87f3dd31d0e5f3bfadede7f
RN0.64 8/*: iOS updates Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/ios/Comm.xcodeproj/project.pbxproj", "new_path": "native/ios/Comm.xcodeproj/project.pbxproj", "diff": "COPY_PHASE_STRIP = NO;\nENABLE_STRICT_OBJC_MSGSEND = YES;\nENABLE_TESTABILITY = YES;\n+ \"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"arm64 \";\nGCC_C_LANGUAGE_STANDARD = gnu99;\nGCC_DYNAMIC_NO_PIC = NO;\nGCC_NO_COMMON_BLOCKS = YES;\nCOPY_PHASE_STRIP = YES;\nENABLE_NS_ASSERTIONS = NO;\nENABLE_STRICT_OBJC_MSGSEND = YES;\n+ \"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"arm64 \";\nGCC_C_LANGUAGE_STANDARD = gnu99;\nGCC_NO_COMMON_BLOCKS = YES;\nGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/AppDelegate.mm", "new_path": "native/ios/Comm/AppDelegate.mm", "diff": "@@ -58,7 +58,11 @@ static void InitializeFlipper(UIApplication *application) {\nRCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge\nmoduleName:@\"Comm\"\ninitialProperties:nil];\n- rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];\n+ if (@available(iOS 13.0, *)) {\n+ rootView.backgroundColor = [UIColor systemBackgroundColor];\n+ } else {\n+ rootView.backgroundColor = [UIColor whiteColor];\n+ }\nself.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\nUIViewController *rootViewController = [UIViewController new];\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile", "new_path": "native/ios/Podfile", "diff": "@@ -11,7 +11,11 @@ target 'Comm' do\npod 'react-native-video/VideoCaching', :podspec => '../../node_modules/react-native-video/react-native-video.podspec'\nconfig = use_native_modules!\n- use_react_native!(:path => config[\"reactNativePath\"])\n+ use_react_native!(\n+ :path => config[:reactNativePath],\n+ # to enable hermes on iOS, change `false` to `true` and then install pods\n+ :hermes_enabled => false\n+ )\nuse_unimodules!(modules_paths: ['../..'])\n@@ -19,9 +23,9 @@ target 'Comm' do\n#\n# Note that if you have use_frameworks! enabled, Flipper will not work and\n# you should disable these next few lines.\n- use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })\n+ use_flipper!({ 'Flipper' => '0.87.0' })\npost_install do |installer|\n- flipper_post_install(installer)\n+ react_native_post_install(installer)\n# Excluding arm64 because M1 simulator isn't supported yet\n# Excluding 32-bit x86 because nobody uses it and it causes compilation issues\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -472,7 +472,7 @@ PODS:\n- Yoga (~> 1.14)\nDEPENDENCIES:\n- - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)\n+ - DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)\n- EXConstants (from `../../node_modules/expo-constants/ios`)\n- EXFileSystem (from `../../node_modules/expo-file-system/ios`)\n- EXImageLoader (from `../../node_modules/expo-image-loader/ios`)\n@@ -480,14 +480,14 @@ DEPENDENCIES:\n- EXMediaLibrary (from `../../node_modules/expo-media-library/ios`)\n- EXPermissions (from `../../node_modules/expo-permissions/ios`)\n- EXSplashScreen (from `../../node_modules/expo-splash-screen/ios`)\n- - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)\n- - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)\n+ - FBLazyVector (from `../../node_modules/react-native/Libraries/FBLazyVector`)\n+ - FBReactNativeSpec (from `../../node_modules/react-native/React/FBReactNativeSpec`)\n- Flipper (= 0.87.0)\n- Flipper-DoubleConversion (= 1.1.7)\n- - Flipper-Folly (= 2.5.3)\n+ - Flipper-Folly (~> 2.5)\n- Flipper-Glog (= 0.3.6)\n- Flipper-PeerTalk (~> 0.0.4)\n- - Flipper-RSocket (= 1.3.1)\n+ - Flipper-RSocket (~> 1.3)\n- FlipperKit (= 0.87.0)\n- FlipperKit/Core (= 0.87.0)\n- FlipperKit/CppBridge (= 0.87.0)\n@@ -501,23 +501,23 @@ DEPENDENCIES:\n- FlipperKit/FlipperKitReactPlugin (= 0.87.0)\n- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.87.0)\n- FlipperKit/SKIOSNetworkPlugin (= 0.87.0)\n- - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)\n+ - glog (from `../../node_modules/react-native/third-party-podspecs/glog.podspec`)\n- lottie-ios (from `../../node_modules/lottie-ios`)\n- lottie-react-native (from `../../node_modules/lottie-react-native`)\n- OLMKit (from `../../node_modules/olm`)\n- - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)\n- - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)\n- - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)\n- - React (from `../node_modules/react-native/`)\n- - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)\n- - React-Core (from `../node_modules/react-native/`)\n- - React-Core/DevSupport (from `../node_modules/react-native/`)\n- - React-Core/RCTWebSocket (from `../node_modules/react-native/`)\n- - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)\n- - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)\n- - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)\n- - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)\n- - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)\n+ - RCT-Folly (from `../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)\n+ - RCTRequired (from `../../node_modules/react-native/Libraries/RCTRequired`)\n+ - RCTTypeSafety (from `../../node_modules/react-native/Libraries/TypeSafety`)\n+ - React (from `../../node_modules/react-native/`)\n+ - React-callinvoker (from `../../node_modules/react-native/ReactCommon/callinvoker`)\n+ - React-Core (from `../../node_modules/react-native/`)\n+ - React-Core/DevSupport (from `../../node_modules/react-native/`)\n+ - React-Core/RCTWebSocket (from `../../node_modules/react-native/`)\n+ - React-CoreModules (from `../../node_modules/react-native/React/CoreModules`)\n+ - React-cxxreact (from `../../node_modules/react-native/ReactCommon/cxxreact`)\n+ - React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)\n+ - React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)\n+ - React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n- react-native-background-upload (from `../../node_modules/react-native-background-upload`)\n- react-native-camera (from `../../node_modules/react-native-camera`)\n- react-native-ffmpeg/min-lts (from `../../node_modules/react-native-ffmpeg/react-native-ffmpeg.podspec`)\n@@ -528,18 +528,18 @@ DEPENDENCIES:\n- react-native-orientation-locker (from `../../node_modules/react-native-orientation-locker`)\n- react-native-safe-area-context (from `../../node_modules/react-native-safe-area-context`)\n- react-native-video/VideoCaching (from `../../node_modules/react-native-video/react-native-video.podspec`)\n- - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)\n- - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)\n- - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)\n- - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)\n- - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)\n- - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)\n- - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)\n- - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)\n- - React-RCTText (from `../node_modules/react-native/Libraries/Text`)\n- - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)\n- - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)\n- - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)\n+ - React-perflogger (from `../../node_modules/react-native/ReactCommon/reactperflogger`)\n+ - React-RCTActionSheet (from `../../node_modules/react-native/Libraries/ActionSheetIOS`)\n+ - React-RCTAnimation (from `../../node_modules/react-native/Libraries/NativeAnimation`)\n+ - React-RCTBlob (from `../../node_modules/react-native/Libraries/Blob`)\n+ - React-RCTImage (from `../../node_modules/react-native/Libraries/Image`)\n+ - React-RCTLinking (from `../../node_modules/react-native/Libraries/LinkingIOS`)\n+ - React-RCTNetwork (from `../../node_modules/react-native/Libraries/Network`)\n+ - React-RCTSettings (from `../../node_modules/react-native/Libraries/Settings`)\n+ - React-RCTText (from `../../node_modules/react-native/Libraries/Text`)\n+ - React-RCTVibration (from `../../node_modules/react-native/Libraries/Vibration`)\n+ - React-runtimeexecutor (from `../../node_modules/react-native/ReactCommon/runtimeexecutor`)\n+ - ReactCommon/turbomodule/core (from `../../node_modules/react-native/ReactCommon`)\n- \"ReactNativeART (from `../../node_modules/@react-native-community/art`)\"\n- ReactNativeDarkMode (from `../../node_modules/react-native-dark-mode`)\n- ReactNativeKeyboardInput (from `../../node_modules/react-native-keyboard-input`)\n@@ -570,7 +570,7 @@ DEPENDENCIES:\n- \"UMReactNativeAdapter (from `../../node_modules/@unimodules/react-native-adapter/ios`)\"\n- UMSensorsInterface (from `../../node_modules/unimodules-sensors-interface/ios`)\n- UMTaskManagerInterface (from `../../node_modules/unimodules-task-manager-interface/ios`)\n- - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)\n+ - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)\nSPEC REPOS:\ntrunk:\n@@ -596,7 +596,7 @@ SPEC REPOS:\nEXTERNAL SOURCES:\nDoubleConversion:\n- :podspec: \"../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec\"\n+ :podspec: \"../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec\"\nEXConstants:\n:path: \"../../node_modules/expo-constants/ios\"\nEXFileSystem:\n@@ -612,11 +612,11 @@ EXTERNAL SOURCES:\nEXSplashScreen:\n:path: \"../../node_modules/expo-splash-screen/ios\"\nFBLazyVector:\n- :path: \"../node_modules/react-native/Libraries/FBLazyVector\"\n+ :path: \"../../node_modules/react-native/Libraries/FBLazyVector\"\nFBReactNativeSpec:\n- :path: \"../node_modules/react-native/React/FBReactNativeSpec\"\n+ :path: \"../../node_modules/react-native/React/FBReactNativeSpec\"\nglog:\n- :podspec: \"../node_modules/react-native/third-party-podspecs/glog.podspec\"\n+ :podspec: \"../../node_modules/react-native/third-party-podspecs/glog.podspec\"\nlottie-ios:\n:path: \"../../node_modules/lottie-ios\"\nlottie-react-native:\n@@ -624,27 +624,27 @@ EXTERNAL SOURCES:\nOLMKit:\n:path: \"../../node_modules/olm\"\nRCT-Folly:\n- :podspec: \"../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec\"\n+ :podspec: \"../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec\"\nRCTRequired:\n- :path: \"../node_modules/react-native/Libraries/RCTRequired\"\n+ :path: \"../../node_modules/react-native/Libraries/RCTRequired\"\nRCTTypeSafety:\n- :path: \"../node_modules/react-native/Libraries/TypeSafety\"\n+ :path: \"../../node_modules/react-native/Libraries/TypeSafety\"\nReact:\n- :path: \"../node_modules/react-native/\"\n+ :path: \"../../node_modules/react-native/\"\nReact-callinvoker:\n- :path: \"../node_modules/react-native/ReactCommon/callinvoker\"\n+ :path: \"../../node_modules/react-native/ReactCommon/callinvoker\"\nReact-Core:\n- :path: \"../node_modules/react-native/\"\n+ :path: \"../../node_modules/react-native/\"\nReact-CoreModules:\n- :path: \"../node_modules/react-native/React/CoreModules\"\n+ :path: \"../../node_modules/react-native/React/CoreModules\"\nReact-cxxreact:\n- :path: \"../node_modules/react-native/ReactCommon/cxxreact\"\n+ :path: \"../../node_modules/react-native/ReactCommon/cxxreact\"\nReact-jsi:\n- :path: \"../node_modules/react-native/ReactCommon/jsi\"\n+ :path: \"../../node_modules/react-native/ReactCommon/jsi\"\nReact-jsiexecutor:\n- :path: \"../node_modules/react-native/ReactCommon/jsiexecutor\"\n+ :path: \"../../node_modules/react-native/ReactCommon/jsiexecutor\"\nReact-jsinspector:\n- :path: \"../node_modules/react-native/ReactCommon/jsinspector\"\n+ :path: \"../../node_modules/react-native/ReactCommon/jsinspector\"\nreact-native-background-upload:\n:path: \"../../node_modules/react-native-background-upload\"\nreact-native-camera:\n@@ -666,29 +666,29 @@ EXTERNAL SOURCES:\nreact-native-video:\n:podspec: \"../../node_modules/react-native-video/react-native-video.podspec\"\nReact-perflogger:\n- :path: \"../node_modules/react-native/ReactCommon/reactperflogger\"\n+ :path: \"../../node_modules/react-native/ReactCommon/reactperflogger\"\nReact-RCTActionSheet:\n- :path: \"../node_modules/react-native/Libraries/ActionSheetIOS\"\n+ :path: \"../../node_modules/react-native/Libraries/ActionSheetIOS\"\nReact-RCTAnimation:\n- :path: \"../node_modules/react-native/Libraries/NativeAnimation\"\n+ :path: \"../../node_modules/react-native/Libraries/NativeAnimation\"\nReact-RCTBlob:\n- :path: \"../node_modules/react-native/Libraries/Blob\"\n+ :path: \"../../node_modules/react-native/Libraries/Blob\"\nReact-RCTImage:\n- :path: \"../node_modules/react-native/Libraries/Image\"\n+ :path: \"../../node_modules/react-native/Libraries/Image\"\nReact-RCTLinking:\n- :path: \"../node_modules/react-native/Libraries/LinkingIOS\"\n+ :path: \"../../node_modules/react-native/Libraries/LinkingIOS\"\nReact-RCTNetwork:\n- :path: \"../node_modules/react-native/Libraries/Network\"\n+ :path: \"../../node_modules/react-native/Libraries/Network\"\nReact-RCTSettings:\n- :path: \"../node_modules/react-native/Libraries/Settings\"\n+ :path: \"../../node_modules/react-native/Libraries/Settings\"\nReact-RCTText:\n- :path: \"../node_modules/react-native/Libraries/Text\"\n+ :path: \"../../node_modules/react-native/Libraries/Text\"\nReact-RCTVibration:\n- :path: \"../node_modules/react-native/Libraries/Vibration\"\n+ :path: \"../../node_modules/react-native/Libraries/Vibration\"\nReact-runtimeexecutor:\n- :path: \"../node_modules/react-native/ReactCommon/runtimeexecutor\"\n+ :path: \"../../node_modules/react-native/ReactCommon/runtimeexecutor\"\nReactCommon:\n- :path: \"../node_modules/react-native/ReactCommon\"\n+ :path: \"../../node_modules/react-native/ReactCommon\"\nReactNativeART:\n:path: \"../../node_modules/@react-native-community/art\"\nReactNativeDarkMode:\n@@ -750,7 +750,7 @@ EXTERNAL SOURCES:\nUMTaskManagerInterface:\n:path: \"../../node_modules/unimodules-task-manager-interface/ios\"\nYoga:\n- :path: \"../node_modules/react-native/ReactCommon/yoga\"\n+ :path: \"../../node_modules/react-native/ReactCommon/yoga\"\nSPEC CHECKSUMS:\nboost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c\n@@ -851,6 +851,6 @@ SPEC CHECKSUMS:\nYoga: 8c8436d4171c87504c648ae23b1d81242bdf3bbf\nYogaKit: f782866e155069a2cca2517aafea43200b01fd5a\n-PODFILE CHECKSUM: 07413d2a10e1148e399ad7e615033828fbf8cf70\n+PODFILE CHECKSUM: 78f6e199959e13aed06f7cfddd9cea01f2ca8f3c\nCOCOAPODS: 1.10.1\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 8/*: iOS updates Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1704
129,187
22.03.2021 23:35:00
14,400
c34e5c46ab90cefade02c8e5243907b167a30e63
RN0.64 9/*: Fix action export Flow types Summary: Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "lib/actions/activity-actions.js", "new_path": "lib/actions/activity-actions.js", "diff": "@@ -14,9 +14,9 @@ const updateActivityActionTypes = Object.freeze({\nsuccess: 'UPDATE_ACTIVITY_SUCCESS',\nfailed: 'UPDATE_ACTIVITY_FAILED',\n});\n-const updateActivity = (fetchJSON: FetchJSON) => async (\n+const updateActivity = (fetchJSON: FetchJSON): (\nactivityUpdates: $ReadOnlyArray<ActivityUpdate>,\n-): Promise<ActivityUpdateSuccessPayload> => {\n+) => Promise<ActivityUpdateSuccessPayload> => async (activityUpdates) => {\nconst response = await fetchJSON('update_activity', {\nupdates: activityUpdates,\n});\n@@ -33,9 +33,9 @@ const setThreadUnreadStatusActionTypes = Object.freeze({\nsuccess: 'SET_THREAD_UNREAD_STATUS_SUCCESS',\nfailed: 'SET_THREAD_UNREAD_STATUS_FAILED',\n});\n-const setThreadUnreadStatus = (fetchJSON: FetchJSON) => async (\n+const setThreadUnreadStatus = (fetchJSON: FetchJSON): (\nrequest: SetThreadUnreadStatusRequest,\n-): Promise<SetThreadUnreadStatusPayload> => {\n+) => Promise<SetThreadUnreadStatusPayload> => async (request) => {\nconst response: SetThreadUnreadStatusResult = await fetchJSON(\n'set_thread_unread_status',\nrequest,\n" }, { "change_type": "MODIFY", "old_path": "lib/actions/device-actions.js", "new_path": "lib/actions/device-actions.js", "diff": "@@ -8,9 +8,9 @@ const setDeviceTokenActionTypes = Object.freeze({\nsuccess: 'SET_DEVICE_TOKEN_SUCCESS',\nfailed: 'SET_DEVICE_TOKEN_FAILED',\n});\n-const setDeviceToken = (fetchJSON: FetchJSON) => async (\n- deviceToken: string,\n-): Promise<string> => {\n+const setDeviceToken = (fetchJSON: FetchJSON): (deviceToken: string) => Promise<string> => async (\n+ deviceToken\n+) => {\nawait fetchJSON('update_device_token', {\ndeviceToken,\nplatformDetails: getConfig().platformDetails,\n" }, { "change_type": "MODIFY", "old_path": "lib/actions/entry-actions.js", "new_path": "lib/actions/entry-actions.js", "diff": "@@ -24,9 +24,11 @@ const fetchEntriesActionTypes = Object.freeze({\nsuccess: 'FETCH_ENTRIES_SUCCESS',\nfailed: 'FETCH_ENTRIES_FAILED',\n});\n-const fetchEntries = (fetchJSON: FetchJSON) => async (\n+const fetchEntries = (fetchJSON: FetchJSON): (\ncalendarQuery: CalendarQuery,\n-): Promise<FetchEntryInfosResult> => {\n+) => Promise<FetchEntryInfosResult> => async (\n+ calendarQuery\n+) => {\nconst response = await fetchJSON('fetch_entries', calendarQuery);\nreturn {\nrawEntryInfos: response.rawEntryInfos,\n@@ -38,10 +40,13 @@ const updateCalendarQueryActionTypes = Object.freeze({\nsuccess: 'UPDATE_CALENDAR_QUERY_SUCCESS',\nfailed: 'UPDATE_CALENDAR_QUERY_FAILED',\n});\n-const updateCalendarQuery = (fetchJSON: FetchJSON) => async (\n+const updateCalendarQuery = (fetchJSON: FetchJSON): (\ncalendarQuery: CalendarQuery,\n- reduxAlreadyUpdated: boolean = false,\n-): Promise<CalendarQueryUpdateResult> => {\n+ reduxAlreadyUpdated?: boolean,\n+) => Promise<CalendarQueryUpdateResult> => async (\n+ calendarQuery,\n+ reduxAlreadyUpdated = false,\n+) => {\nconst response = await fetchJSON('update_calendar_query', calendarQuery);\nconst { rawEntryInfos, deletedEntryIDs } = response;\nreturn {\n@@ -79,9 +84,11 @@ const createEntryActionTypes = Object.freeze({\nsuccess: 'CREATE_ENTRY_SUCCESS',\nfailed: 'CREATE_ENTRY_FAILED',\n});\n-const createEntry = (fetchJSON: FetchJSON) => async (\n+const createEntry = (fetchJSON: FetchJSON): (\nrequest: CreateEntryInfo,\n-): Promise<CreateEntryPayload> => {\n+) => Promise<CreateEntryPayload> => async (\n+ request\n+) => {\nconst result = await fetchJSON('create_entry', request);\nreturn {\nentryID: result.entryID,\n@@ -98,9 +105,11 @@ const saveEntryActionTypes = Object.freeze({\nfailed: 'SAVE_ENTRY_FAILED',\n});\nconst concurrentModificationResetActionType = 'CONCURRENT_MODIFICATION_RESET';\n-const saveEntry = (fetchJSON: FetchJSON) => async (\n+const saveEntry = (fetchJSON: FetchJSON): (\nrequest: SaveEntryInfo,\n-): Promise<SaveEntryResult> => {\n+) => Promise<SaveEntryResult> => async (\n+ request\n+) => {\nconst result = await fetchJSON('update_entry', request);\nreturn {\nentryID: result.entryID,\n@@ -114,9 +123,11 @@ const deleteEntryActionTypes = Object.freeze({\nsuccess: 'DELETE_ENTRY_SUCCESS',\nfailed: 'DELETE_ENTRY_FAILED',\n});\n-const deleteEntry = (fetchJSON: FetchJSON) => async (\n+const deleteEntry = (fetchJSON: FetchJSON): (\ninfo: DeleteEntryInfo,\n-): Promise<DeleteEntryResult> => {\n+) => Promise<DeleteEntryResult> => async (\n+ info\n+) => {\nconst response = await fetchJSON('delete_entry', {\n...info,\ntimestamp: Date.now(),\n@@ -133,9 +144,11 @@ const fetchRevisionsForEntryActionTypes = Object.freeze({\nsuccess: 'FETCH_REVISIONS_FOR_ENTRY_SUCCESS',\nfailed: 'FETCH_REVISIONS_FOR_ENTRY_FAILED',\n});\n-const fetchRevisionsForEntry = (fetchJSON: FetchJSON) => async (\n+const fetchRevisionsForEntry = (fetchJSON: FetchJSON): (\nentryID: string,\n-): Promise<$ReadOnlyArray<HistoryRevisionInfo>> => {\n+) => Promise<$ReadOnlyArray<HistoryRevisionInfo>> => async (\n+ entryID\n+) => {\nconst response = await fetchJSON('fetch_entry_revisions', { id: entryID });\nreturn response.result;\n};\n@@ -145,9 +158,11 @@ const restoreEntryActionTypes = Object.freeze({\nsuccess: 'RESTORE_ENTRY_SUCCESS',\nfailed: 'RESTORE_ENTRY_FAILED',\n});\n-const restoreEntry = (fetchJSON: FetchJSON) => async (\n+const restoreEntry = (fetchJSON: FetchJSON): (\ninfo: RestoreEntryInfo,\n-): Promise<RestoreEntryResult> => {\n+) => Promise<RestoreEntryResult> => async (\n+ info\n+) => {\nconst response = await fetchJSON('restore_entry', {\n...info,\ntimestamp: Date.now(),\n" }, { "change_type": "MODIFY", "old_path": "lib/actions/message-actions.js", "new_path": "lib/actions/message-actions.js", "diff": "@@ -13,10 +13,13 @@ const fetchMessagesBeforeCursorActionTypes = Object.freeze({\nsuccess: 'FETCH_MESSAGES_BEFORE_CURSOR_SUCCESS',\nfailed: 'FETCH_MESSAGES_BEFORE_CURSOR_FAILED',\n});\n-const fetchMessagesBeforeCursor = (fetchJSON: FetchJSON) => async (\n+const fetchMessagesBeforeCursor = (fetchJSON: FetchJSON): (\nthreadID: string,\nbeforeMessageID: string,\n-): Promise<FetchMessageInfosPayload> => {\n+) => Promise<FetchMessageInfosPayload> => async (\n+ threadID,\n+ beforeMessageID,\n+) => {\nconst response = await fetchJSON('fetch_messages', {\ncursors: {\n[threadID]: beforeMessageID,\n@@ -34,9 +37,11 @@ const fetchMostRecentMessagesActionTypes = Object.freeze({\nsuccess: 'FETCH_MOST_RECENT_MESSAGES_SUCCESS',\nfailed: 'FETCH_MOST_RECENT_MESSAGES_FAILED',\n});\n-const fetchMostRecentMessages = (fetchJSON: FetchJSON) => async (\n+const fetchMostRecentMessages = (fetchJSON: FetchJSON): (\nthreadID: string,\n-): Promise<FetchMessageInfosPayload> => {\n+) => Promise<FetchMessageInfosPayload> => async (\n+ threadID\n+) => {\nconst response = await fetchJSON('fetch_messages', {\ncursors: {\n[threadID]: null,\n@@ -54,11 +59,15 @@ const sendTextMessageActionTypes = Object.freeze({\nsuccess: 'SEND_TEXT_MESSAGE_SUCCESS',\nfailed: 'SEND_TEXT_MESSAGE_FAILED',\n});\n-const sendTextMessage = (fetchJSON: FetchJSON) => async (\n+const sendTextMessage = (fetchJSON: FetchJSON): (\nthreadID: string,\nlocalID: string,\ntext: string,\n-): Promise<SendMessageResult> => {\n+) => Promise<SendMessageResult> => async (\n+ threadID,\n+ localID,\n+ text,\n+) => {\nlet resultInfo;\nconst getResultInfo = (passedResultInfo: FetchResultInfo) => {\nresultInfo = passedResultInfo;\n@@ -91,11 +100,15 @@ const sendMultimediaMessageActionTypes = Object.freeze({\nsuccess: 'SEND_MULTIMEDIA_MESSAGE_SUCCESS',\nfailed: 'SEND_MULTIMEDIA_MESSAGE_FAILED',\n});\n-const sendMultimediaMessage = (fetchJSON: FetchJSON) => async (\n+const sendMultimediaMessage = (fetchJSON: FetchJSON): (\nthreadID: string,\nlocalID: string,\nmediaIDs: $ReadOnlyArray<string>,\n-): Promise<SendMessageResult> => {\n+) => Promise<SendMessageResult> => async (\n+ threadID,\n+ localID,\n+ mediaIDs,\n+) => {\nlet resultInfo;\nconst getResultInfo = (passedResultInfo: FetchResultInfo) => {\nresultInfo = passedResultInfo;\n" }, { "change_type": "MODIFY", "old_path": "lib/actions/relationship-actions.js", "new_path": "lib/actions/relationship-actions.js", "diff": "@@ -12,9 +12,11 @@ const updateRelationshipsActionTypes = Object.freeze({\nsuccess: 'UPDATE_RELATIONSHIPS_SUCCESS',\nfailed: 'UPDATE_RELATIONSHIPS_FAILED',\n});\n-const updateRelationships = (fetchJSON: FetchJSON) => async (\n+const updateRelationships = (fetchJSON: FetchJSON): (\nrequest: RelationshipRequest,\n-): Promise<RelationshipErrors> => {\n+) => Promise<RelationshipErrors> => async (\n+ request\n+) => {\nconst errors = await fetchJSON('update_relationships', request);\nconst { invalid_user, already_friends, user_blocked } = errors;\n" }, { "change_type": "MODIFY", "old_path": "lib/actions/report-actions.js", "new_path": "lib/actions/report-actions.js", "diff": "@@ -12,9 +12,11 @@ const sendReportActionTypes = Object.freeze({\nfailed: 'SEND_REPORT_FAILED',\n});\nconst fetchJSONOptions = { timeout: 60000 };\n-const sendReport = (fetchJSON: FetchJSON) => async (\n+const sendReport = (fetchJSON: FetchJSON): (\nrequest: ClientReportCreationRequest,\n-): Promise<ReportCreationResponse> => {\n+) => Promise<ReportCreationResponse> => async (\n+ request,\n+) => {\nconst response = await fetchJSON('create_report', request, fetchJSONOptions);\nreturn { id: response.id };\n};\n@@ -24,9 +26,11 @@ const sendReportsActionTypes = Object.freeze({\nsuccess: 'SEND_REPORTS_SUCCESS',\nfailed: 'SEND_REPORTS_FAILED',\n});\n-const sendReports = (fetchJSON: FetchJSON) => async (\n+const sendReports = (fetchJSON: FetchJSON): (\nreports: $ReadOnlyArray<ClientReportCreationRequest>,\n-): Promise<void> => {\n+) => Promise<void> => async (\n+ reports,\n+) => {\nawait fetchJSON('create_reports', { reports }, fetchJSONOptions);\n};\n" }, { "change_type": "MODIFY", "old_path": "lib/actions/thread-actions.js", "new_path": "lib/actions/thread-actions.js", "diff": "@@ -19,10 +19,13 @@ const deleteThreadActionTypes = Object.freeze({\nsuccess: 'DELETE_THREAD_SUCCESS',\nfailed: 'DELETE_THREAD_FAILED',\n});\n-const deleteThread = (fetchJSON: FetchJSON) => async (\n+const deleteThread = (fetchJSON: FetchJSON): (\nthreadID: string,\ncurrentAccountPassword: string,\n-): Promise<LeaveThreadPayload> => {\n+) => Promise<LeaveThreadPayload> => async (\n+ threadID,\n+ currentAccountPassword,\n+) => {\nconst response = await fetchJSON('delete_thread', {\nthreadID,\naccountPassword: currentAccountPassword,\n@@ -37,9 +40,11 @@ const changeThreadSettingsActionTypes = Object.freeze({\nsuccess: 'CHANGE_THREAD_SETTINGS_SUCCESS',\nfailed: 'CHANGE_THREAD_SETTINGS_FAILED',\n});\n-const changeThreadSettings = (fetchJSON: FetchJSON) => async (\n+const changeThreadSettings = (fetchJSON: FetchJSON): (\nrequest: UpdateThreadRequest,\n-): Promise<ChangeThreadSettingsPayload> => {\n+) => Promise<ChangeThreadSettingsPayload> => async (\n+ request\n+) => {\nconst response = await fetchJSON('update_thread', request);\ninvariant(\nObject.keys(request.changes).length > 0,\n@@ -57,10 +62,13 @@ const removeUsersFromThreadActionTypes = Object.freeze({\nsuccess: 'REMOVE_USERS_FROM_THREAD_SUCCESS',\nfailed: 'REMOVE_USERS_FROM_THREAD_FAILED',\n});\n-const removeUsersFromThread = (fetchJSON: FetchJSON) => async (\n+const removeUsersFromThread = (fetchJSON: FetchJSON): (\nthreadID: string,\n- memberIDs: string[],\n-): Promise<ChangeThreadSettingsPayload> => {\n+ memberIDs: $ReadOnlyArray<string>,\n+) => Promise<ChangeThreadSettingsPayload> => async (\n+ threadID,\n+ memberIDs\n+) => {\nconst response = await fetchJSON('remove_members', {\nthreadID,\nmemberIDs,\n@@ -77,11 +85,15 @@ const changeThreadMemberRolesActionTypes = Object.freeze({\nsuccess: 'CHANGE_THREAD_MEMBER_ROLES_SUCCESS',\nfailed: 'CHANGE_THREAD_MEMBER_ROLES_FAILED',\n});\n-const changeThreadMemberRoles = (fetchJSON: FetchJSON) => async (\n+const changeThreadMemberRoles = (fetchJSON: FetchJSON): (\nthreadID: string,\n- memberIDs: string[],\n+ memberIDs: $ReadOnlyArray<string>,\nnewRole: string,\n-): Promise<ChangeThreadSettingsPayload> => {\n+) => Promise<ChangeThreadSettingsPayload> => async (\n+ threadID,\n+ memberIDs,\n+ newRole,\n+) => {\nconst response = await fetchJSON('update_role', {\nthreadID,\nmemberIDs,\n@@ -99,9 +111,11 @@ const newThreadActionTypes = Object.freeze({\nsuccess: 'NEW_THREAD_SUCCESS',\nfailed: 'NEW_THREAD_FAILED',\n});\n-const newThread = (fetchJSON: FetchJSON) => async (\n+const newThread = (fetchJSON: FetchJSON): (\nrequest: ClientNewThreadRequest,\n-): Promise<NewThreadResult> => {\n+) => Promise<NewThreadResult> => async (\n+ request\n+) => {\nconst response = await fetchJSON('create_thread', request);\nreturn {\nnewThreadID: response.newThreadID,\n@@ -116,9 +130,11 @@ const joinThreadActionTypes = Object.freeze({\nsuccess: 'JOIN_THREAD_SUCCESS',\nfailed: 'JOIN_THREAD_FAILED',\n});\n-const joinThread = (fetchJSON: FetchJSON) => async (\n+const joinThread = (fetchJSON: FetchJSON): (\nrequest: ClientThreadJoinRequest,\n-): Promise<ThreadJoinPayload> => {\n+) => Promise<ThreadJoinPayload> => async (\n+ request\n+) => {\nconst response = await fetchJSON('join_thread', request);\nconst userInfos = values(response.userInfos);\nreturn {\n@@ -134,9 +150,11 @@ const leaveThreadActionTypes = Object.freeze({\nsuccess: 'LEAVE_THREAD_SUCCESS',\nfailed: 'LEAVE_THREAD_FAILED',\n});\n-const leaveThread = (fetchJSON: FetchJSON) => async (\n+const leaveThread = (fetchJSON: FetchJSON): (\nthreadID: string,\n-): Promise<LeaveThreadPayload> => {\n+) => Promise<LeaveThreadPayload> => async (\n+ threadID\n+) => {\nconst response = await fetchJSON('leave_thread', { threadID });\nreturn {\nupdatesResult: response.updatesResult,\n" }, { "change_type": "MODIFY", "old_path": "lib/actions/upload-actions.js", "new_path": "lib/actions/upload-actions.js", "diff": "@@ -12,11 +12,15 @@ export type MultimediaUploadCallbacks = Shape<{|\n|}>;\nexport type MultimediaUploadExtras = Shape<{| ...Dimensions, loop: boolean |}>;\n-const uploadMultimedia = (fetchJSON: FetchJSON) => async (\n+const uploadMultimedia = (fetchJSON: FetchJSON): (\nmultimedia: Object,\nextras: MultimediaUploadExtras,\ncallbacks?: MultimediaUploadCallbacks,\n-): Promise<UploadMultimediaResult> => {\n+) => Promise<UploadMultimediaResult> => async (\n+ multimedia,\n+ extras,\n+ callbacks\n+) => {\nconst onProgress = callbacks && callbacks.onProgress;\nconst abortHandler = callbacks && callbacks.abortHandler;\nconst uploadBlob = callbacks && callbacks.uploadBlob;\n@@ -57,9 +61,9 @@ const uploadMultimedia = (fetchJSON: FetchJSON) => async (\nconst updateMultimediaMessageMediaActionType =\n'UPDATE_MULTIMEDIA_MESSAGE_MEDIA';\n-const deleteUpload = (fetchJSON: FetchJSON) => async (\n+const deleteUpload = (fetchJSON: FetchJSON): (\nid: string,\n-): Promise<void> => {\n+) => Promise<void> => async (id) => {\nawait fetchJSON('delete_upload', { id });\n};\n" }, { "change_type": "MODIFY", "old_path": "lib/actions/user-actions.js", "new_path": "lib/actions/user-actions.js", "diff": "@@ -25,9 +25,11 @@ const logOutActionTypes = Object.freeze({\nsuccess: 'LOG_OUT_SUCCESS',\nfailed: 'LOG_OUT_FAILED',\n});\n-const logOut = (fetchJSON: FetchJSON) => async (\n+const logOut = (fetchJSON: FetchJSON): (\npreRequestUserState: PreRequestUserState,\n-): Promise<LogOutResult> => {\n+) => Promise<LogOutResult> => async (\n+ preRequestUserState\n+) => {\nlet response = null;\ntry {\nresponse = await Promise.race([\n@@ -47,10 +49,13 @@ const deleteAccountActionTypes = Object.freeze({\nsuccess: 'DELETE_ACCOUNT_SUCCESS',\nfailed: 'DELETE_ACCOUNT_FAILED',\n});\n-const deleteAccount = (fetchJSON: FetchJSON) => async (\n+const deleteAccount = (fetchJSON: FetchJSON): (\npassword: string,\npreRequestUserState: PreRequestUserState,\n-): Promise<LogOutResult> => {\n+) => Promise<LogOutResult> => async (\n+ password,\n+ preRequestUserState\n+) => {\nconst response = await fetchJSON('delete_account', { password });\nreturn { currentUserInfo: response.currentUserInfo, preRequestUserState };\n};\n@@ -60,9 +65,11 @@ const registerActionTypes = Object.freeze({\nsuccess: 'REGISTER_SUCCESS',\nfailed: 'REGISTER_FAILED',\n});\n-const register = (fetchJSON: FetchJSON) => async (\n+const register = (fetchJSON: FetchJSON): (\nregisterInfo: RegisterInfo,\n-): Promise<RegisterResult> => {\n+) => Promise<RegisterResult> => async (\n+ registerInfo\n+) => {\nconst response = await fetchJSON('create_account', {\n...registerInfo,\nplatformDetails: getConfig().platformDetails,\n@@ -107,9 +114,11 @@ const logInActionTypes = Object.freeze({\nfailed: 'LOG_IN_FAILED',\n});\nconst logInFetchJSONOptions = { timeout: 60000 };\n-const logIn = (fetchJSON: FetchJSON) => async (\n+const logIn = (fetchJSON: FetchJSON): (\nlogInInfo: LogInInfo,\n-): Promise<LogInResult> => {\n+) => Promise<LogInResult> => async (\n+ logInInfo\n+) => {\nconst watchedIDs = threadWatcher.getWatchedIDs();\nconst { source, ...restLogInInfo } = logInInfo;\nconst response = await fetchJSON(\n@@ -149,9 +158,11 @@ const changeUserSettingsActionTypes = Object.freeze({\nsuccess: 'CHANGE_USER_SETTINGS_SUCCESS',\nfailed: 'CHANGE_USER_SETTINGS_FAILED',\n});\n-const changeUserSettings = (fetchJSON: FetchJSON) => async (\n+const changeUserSettings = (fetchJSON: FetchJSON): (\naccountUpdate: AccountUpdate,\n-): Promise<void> => {\n+) => Promise<void> => async (\n+ accountUpdate\n+) => {\nawait fetchJSON('update_account', accountUpdate);\n};\n@@ -160,9 +171,11 @@ const searchUsersActionTypes = Object.freeze({\nsuccess: 'SEARCH_USERS_SUCCESS',\nfailed: 'SEARCH_USERS_FAILED',\n});\n-const searchUsers = (fetchJSON: FetchJSON) => async (\n+const searchUsers = (fetchJSON: FetchJSON): (\nusernamePrefix: string,\n-): Promise<UserSearchResult> => {\n+) => Promise<UserSearchResult> => async (\n+ usernamePrefix\n+) => {\nconst response = await fetchJSON('search_users', { prefix: usernamePrefix });\nreturn {\nuserInfos: response.userInfos,\n@@ -174,9 +187,11 @@ const updateSubscriptionActionTypes = Object.freeze({\nsuccess: 'UPDATE_SUBSCRIPTION_SUCCESS',\nfailed: 'UPDATE_SUBSCRIPTION_FAILED',\n});\n-const updateSubscription = (fetchJSON: FetchJSON) => async (\n+const updateSubscription = (fetchJSON: FetchJSON): (\nsubscriptionUpdate: SubscriptionUpdateRequest,\n-): Promise<SubscriptionUpdateResult> => {\n+) => Promise<SubscriptionUpdateResult> => async (\n+ subscriptionUpdate\n+) => {\nconst response = await fetchJSON(\n'update_user_subscription',\nsubscriptionUpdate,\n@@ -192,9 +207,11 @@ const requestAccessActionTypes = Object.freeze({\nsuccess: 'REQUEST_ACCESS_SUCCESS',\nfailed: 'REQUEST_ACCESS_FAILED',\n});\n-const requestAccess = (fetchJSON: FetchJSON) => async (\n+const requestAccess = (fetchJSON: FetchJSON): (\naccessRequest: AccessRequest,\n-): Promise<void> => {\n+) => Promise<void> => async (\n+ accessRequest\n+) => {\nawait fetchJSON('request_access', accessRequest);\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 9/*: Fix action export Flow types Summary: https://flow.org/en/docs/lang/types-first/ Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1705
129,187
23.03.2021 00:47:49
14,400
bb9ee3119a9f3721007eb087d819d56f0b2aebee
RN0.64 11/*: Fix simple-markdown Flow types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "lib/shared/markdown.js", "new_path": "lib/shared/markdown.js", "diff": "@@ -6,51 +6,100 @@ import type { RelativeMemberInfo } from '../types/thread-types';\nimport { oldValidUsernameRegexString } from './account-utils';\n// simple-markdown types\n-type State = {|\n+export type State = {|\nkey?: string | number | void,\ninline?: ?boolean,\n[string]: any,\n|};\n-type Parser = (source: string, state?: ?State) => Array<SingleASTNode>;\n+export type Parser = (source: string, state?: ?State) => Array<SingleASTNode>;\n-type Capture =\n- | (Array<string> & { index: number })\n- | (Array<string> & { index?: number });\n+export type Capture =\n+ | (Array<string> & { +index: number, ... })\n+ | (Array<string> & { +index?: number, ... });\n-type SingleASTNode = {|\n+export type SingleASTNode = {|\ntype: string,\n[string]: any,\n|};\n+export type ASTNode = SingleASTNode | Array<SingleASTNode>;\n+\ntype UnTypedASTNode = {\n[string]: any,\n...\n};\n-const paragraphRegex = /^((?:[^\\n]*)(?:\\n|$))/;\n-const paragraphStripTrailingNewlineRegex = /^([^\\n]*)(?:\\n|$)/;\n+type MatchFunction = { regex?: RegExp, ... } & (\n+ source: string,\n+ state: State,\n+ prevCapture: string\n+) => ?Capture;\n+\n+export type ReactElement = React$Element<any>;\n+type ReactElements = React$Node;\n+\n+export type Output<Result> = (\n+ node: ASTNode,\n+ state?: ?State\n+) => Result;\n+\n+type ArrayNodeOutput<Result> = (\n+ node: Array<SingleASTNode>,\n+ nestedOutput: Output<Result>,\n+ state: State\n+) => Result;\n+\n+type ArrayRule = {\n+ +react?: ArrayNodeOutput<ReactElements>,\n+ +html?: ArrayNodeOutput<string>,\n+ +[string]: ArrayNodeOutput<any>,\n+};\n+\n+type ParseFunction = (\n+ capture: Capture,\n+ nestedParse: Parser,\n+ state: State,\n+) => (UnTypedASTNode | ASTNode);\n+\n+type ParserRule = {\n+ +order: number,\n+ +match: MatchFunction,\n+ +quality?: (capture: Capture, state: State, prevCapture: string) => number,\n+ +parse: ParseFunction,\n+ ...\n+};\n+\n+export type ParserRules = {\n+ +Array?: ArrayRule,\n+ +[type: string]: ParserRule,\n+ ...\n+};\n-const headingRegex = /^ *(#{1,6}) ([^\\n]+?)#* *(?![^\\n])/;\n-const headingStripFollowingNewlineRegex = /^ *(#{1,6}) ([^\\n]+?)#* *(?:\\n|$)/;\n+const paragraphRegex: RegExp = /^((?:[^\\n]*)(?:\\n|$))/;\n+const paragraphStripTrailingNewlineRegex: RegExp = /^([^\\n]*)(?:\\n|$)/;\n-const fenceRegex = /^(`{3,}|~{3,})[^\\n]*\\n([\\s\\S]*?\\n)\\1(?:\\n|$)/;\n-const fenceStripTrailingNewlineRegex = /^(`{3,}|~{3,})[^\\n]*\\n([\\s\\S]*?)\\n\\1(?:\\n|$)/;\n+const headingRegex: RegExp = /^ *(#{1,6}) ([^\\n]+?)#* *(?![^\\n])/;\n+const headingStripFollowingNewlineRegex: RegExp = /^ *(#{1,6}) ([^\\n]+?)#* *(?:\\n|$)/;\n-const codeBlockRegex = /^(?: {4}[^\\n]*\\n*?)+(?!\\n* {4}[^\\n])(?:\\n|$)/;\n-const codeBlockStripTrailingNewlineRegex = /^((?: {4}[^\\n]*\\n*?)+)(?!\\n* {4}[^\\n])(?:\\n|$)/;\n+const fenceRegex: RegExp = /^(`{3,}|~{3,})[^\\n]*\\n([\\s\\S]*?\\n)\\1(?:\\n|$)/;\n+const fenceStripTrailingNewlineRegex: RegExp = /^(`{3,}|~{3,})[^\\n]*\\n([\\s\\S]*?)\\n\\1(?:\\n|$)/;\n-const blockQuoteRegex = /^( *>[^\\n]+(?:\\n[^\\n]+)*)(?:\\n|$)/;\n-const blockQuoteStripFollowingNewlineRegex = /^( *>[^\\n]+(?:\\n[^\\n]+)*)(?:\\n|$){2}/;\n+const codeBlockRegex: RegExp = /^(?: {4}[^\\n]*\\n*?)+(?!\\n* {4}[^\\n])(?:\\n|$)/;\n+const codeBlockStripTrailingNewlineRegex: RegExp = /^((?: {4}[^\\n]*\\n*?)+)(?!\\n* {4}[^\\n])(?:\\n|$)/;\n-const urlRegex = /^(https?:\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])/i;\n+const blockQuoteRegex: RegExp = /^( *>[^\\n]+(?:\\n[^\\n]+)*)(?:\\n|$)/;\n+const blockQuoteStripFollowingNewlineRegex: RegExp = /^( *>[^\\n]+(?:\\n[^\\n]+)*)(?:\\n|$){2}/;\n+\n+const urlRegex: RegExp = /^(https?:\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])/i;\nconst mentionRegex = new RegExp(`^(@(${oldValidUsernameRegexString}))\\\\b`);\n-type JSONCapture = {|\n- +[0]: string,\n+export type JSONCapture = Array<string> & {\n+json: Object,\n-|};\n+ +index?: void,\n+ ...\n+};\nfunction jsonMatch(source: string): ?JSONCapture {\nif (!source.startsWith('{')) {\nreturn null;\n@@ -84,10 +133,7 @@ function jsonMatch(source: string): ?JSONCapture {\nreturn null;\n}\n- return {\n- [0]: jsonString,\n- json,\n- };\n+ return { ...([jsonString]: any), json };\n}\nfunction jsonPrint(capture: JSONCapture): string {\n@@ -99,7 +145,7 @@ const listItemRegex = /^( *)([*+-]|\\d+\\.) [^\\n]*(?:\\n(?!\\1(?:[*+-]|\\d+\\.) )[^\\n]\nconst listItemPrefixRegex = /^( *)([*+-]|\\d+\\.) /;\nconst listLookBehindRegex = /(?:^|\\n)( *)$/;\n-function matchList(source: string, state: State) {\n+function matchList(source: string, state: State): RegExp$matchResult | null {\nif (state.inline) {\nreturn null;\n}\n@@ -148,7 +194,7 @@ function parseList(\n};\n}\n-function matchMentions(members: $ReadOnlyArray<RelativeMemberInfo>) {\n+function matchMentions(members: $ReadOnlyArray<RelativeMemberInfo>): MatchFunction {\nconst memberSet = new Set(\nmembers\n.filter(({ role }) => role)\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/message-utils.js", "new_path": "lib/shared/message-utils.js", "diff": "import invariant from 'invariant';\nimport _maxBy from 'lodash/fp/maxBy';\nimport _orderBy from 'lodash/fp/orderBy';\n-import { type ParserRules } from 'simple-markdown';\nimport { multimediaMessagePreview } from '../media/media-utils';\nimport { userIDsToRelativeUserInfos } from '../selectors/user-selectors';\n@@ -30,7 +29,7 @@ import type { ImagesMessageData } from '../types/messages/images';\nimport type { MediaMessageData } from '../types/messages/media';\nimport { type ThreadInfo } from '../types/thread-types';\nimport type { RelativeUserInfo, UserInfos } from '../types/user-types';\n-import { codeBlockRegex } from './markdown';\n+import { codeBlockRegex, type ParserRules } from './markdown';\nimport { messageSpecs } from './messages/message-specs';\nimport { stringForUser } from './user-utils';\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/message-spec.js", "new_path": "lib/shared/messages/message-spec.js", "diff": "// @flow\n-import { type ParserRules } from 'simple-markdown';\n+import { type ParserRules } from '../markdown';\nimport type { PlatformDetails } from '../../types/device-types';\nimport type { Media } from '../../types/media-types';\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/text-message-spec.js", "new_path": "lib/shared/messages/text-message-spec.js", "diff": "@@ -21,26 +21,29 @@ import type {\nRawMessageInfoFromRowParams,\n} from './message-spec';\nimport { assertSingleMessageInfo } from './utils';\n+import { type ASTNode, type SingleASTNode } from '../markdown';\n/**\n* most of the markdown leaves contain `content` field (it is an array or a string)\n* apart from lists, which have `items` field (that holds an array)\n*/\n-const rawTextFromMarkdownAST = (node: SimpleMarkdown.ASTNode): string => {\n- if (node.content && typeof node.content === 'string') {\n- return node.content;\n- } else if (node.items) {\n- return rawTextFromMarkdownAST(node.items);\n- } else if (node.content) {\n- return rawTextFromMarkdownAST(node.content);\n- } else if (Array.isArray(node)) {\n+const rawTextFromMarkdownAST = (node: ASTNode): string => {\n+ if (Array.isArray(node)) {\nreturn node.map(rawTextFromMarkdownAST).join('');\n}\n+ const { content, items } = node;\n+ if (content && typeof content === 'string') {\n+ return content;\n+ } else if (items) {\n+ return rawTextFromMarkdownAST(items);\n+ } else if (content) {\n+ return rawTextFromMarkdownAST(content);\n+ }\nreturn '';\n};\nconst getFirstNonQuotedRawLine = (\n- nodes: $ReadOnlyArray<SimpleMarkdown.SingleASTNode>,\n+ nodes: $ReadOnlyArray<SingleASTNode>,\n): string => {\nlet result = 'message';\nfor (const node of nodes) {\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/thread-utils.js", "new_path": "lib/shared/thread-utils.js", "diff": "import invariant from 'invariant';\nimport _find from 'lodash/fp/find';\nimport * as React from 'react';\n-import { type ParserRules } from 'simple-markdown';\n+import { type ParserRules } from './markdown';\nimport tinycolor from 'tinycolor2';\nimport {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 11/*: Fix simple-markdown Flow types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1707
129,187
23.03.2021 01:09:20
14,400
2e7eec76ac46f7b0a0807d432fe82d8384d3d6e8
RN0.64 12/*: Fix socket export Flow types Summary: Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "lib/socket/activity-handler.react.js", "new_path": "lib/socket/activity-handler.react.js", "diff": "@@ -16,7 +16,7 @@ type Props = {|\n+activeThread: ?string,\n+frozen: boolean,\n|};\n-function ActivityHandler(props: Props) {\n+function ActivityHandler(props: Props): React.Node {\nconst { activeThread, frozen } = props;\nconst prevActiveThreadRef = React.useRef();\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/api-request-handler.react.js", "new_path": "lib/socket/api-request-handler.react.js", "diff": "@@ -89,9 +89,11 @@ class APIRequestHandler extends React.PureComponent<Props> {\n};\n}\n-export default React.memo<BaseProps>(function ConnectedAPIRequestHandler(\n- props: BaseProps,\n+const ConnectedAPIRequestHandler: React.AbstractComponent<BaseProps, mixed> = React.memo<BaseProps>(function ConnectedAPIRequestHandler(\n+ props\n) {\nconst connection = useSelector(state => state.connection);\nreturn <APIRequestHandler {...props} connection={connection} />;\n});\n+\n+export default ConnectedAPIRequestHandler;\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/calendar-query-handler.react.js", "new_path": "lib/socket/calendar-query-handler.react.js", "diff": "@@ -120,8 +120,8 @@ class CalendarQueryHandler extends React.PureComponent<Props> {\n};\n}\n-export default React.memo<BaseProps>(function ConnectedCalendarQueryHandler(\n- props: BaseProps,\n+ const ConnectedCalendarQueryHandler: React.AbstractComponent<BaseProps, mixed> = React.memo<BaseProps>(function ConnectedCalendarQueryHandler(\n+ props\n) {\nconst connection = useSelector(state => state.connection);\nconst lastUserInteractionCalendar = useSelector(\n@@ -143,3 +143,4 @@ export default React.memo<BaseProps>(function ConnectedCalendarQueryHandler(\n/>\n);\n});\n+export default ConnectedCalendarQueryHandler;\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/inflight-requests.js", "new_path": "lib/socket/inflight-requests.js", "diff": "@@ -231,7 +231,7 @@ class InflightRequests {\n}\n}\n- allRequestsResolvedExcept(excludeMessageID: ?number) {\n+ allRequestsResolvedExcept(excludeMessageID: ?number): boolean {\nfor (const inflightRequest of this.data) {\nconst { expectedResponseType } = inflightRequest;\nif (\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/message-handler.react.js", "new_path": "lib/socket/message-handler.react.js", "diff": "@@ -14,7 +14,7 @@ type Props = {|\n+addListener: (listener: SocketListener) => void,\n+removeListener: (listener: SocketListener) => void,\n|};\n-export default function MessageHandler(props: Props) {\n+export default function MessageHandler(props: Props): React.Node {\nconst { addListener, removeListener } = props;\nconst dispatch = useDispatch();\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/report-handler.react.js", "new_path": "lib/socket/report-handler.react.js", "diff": "@@ -75,8 +75,8 @@ class ReportHandler extends React.PureComponent<Props> {\n}\n}\n-export default React.memo<BaseProps>(function ConnectedReportHandler(\n- props: BaseProps,\n+const ConnectedReportHandler: React.AbstractComponent<BaseProps, mixed> = React.memo<BaseProps>(function ConnectedReportHandler(\n+ props\n) {\nconst queuedReports = useSelector(queuedReportsSelector);\nconst callSendReports = useServerCall(sendReports);\n@@ -91,3 +91,5 @@ export default React.memo<BaseProps>(function ConnectedReportHandler(\n/>\n);\n});\n+\n+export default ConnectedReportHandler;\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/request-response-handler.react.js", "new_path": "lib/socket/request-response-handler.react.js", "diff": "@@ -132,8 +132,8 @@ class RequestResponseHandler extends React.PureComponent<Props> {\n}\n}\n-export default React.memo<BaseProps>(function ConnectedRequestResponseHandler(\n- props: BaseProps,\n+const ConnectedRequestResponseHandler: React.AbstractComponent<BaseProps, mixed> = React.memo<BaseProps>(function ConnectedRequestResponseHandler(\n+ props\n) {\nconst connection = useSelector(state => state.connection);\nconst dispatch = useDispatch();\n@@ -146,3 +146,4 @@ export default React.memo<BaseProps>(function ConnectedRequestResponseHandler(\n/>\n);\n});\n+export default ConnectedRequestResponseHandler;\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/socket.react.js", "new_path": "lib/socket/socket.react.js", "diff": "@@ -112,13 +112,13 @@ class Socket extends React.PureComponent<Props, State> {\ninflightRequests: null,\n};\nsocket: ?WebSocket;\n- nextClientMessageID = 0;\n+ nextClientMessageID: number = 0;\nlisteners: Set<SocketListener> = new Set();\npingTimeoutID: ?TimeoutID;\nmessageLastReceived: ?number;\n- initialPlatformDetailsSent = getConfig().platformDetails.platform === 'web';\n- reopenConnectionAfterClosing = false;\n- invalidationRecoveryInProgress = false;\n+ initialPlatformDetailsSent: boolean = getConfig().platformDetails.platform === 'web';\n+ reopenConnectionAfterClosing: boolean = false;\n+ invalidationRecoveryInProgress: boolean = false;\ninitializedWithUserState: ?PreRequestUserState;\nopenSocket(newStatus: ConnectionStatus) {\n@@ -271,7 +271,7 @@ class Socket extends React.PureComponent<Props, State> {\n}\n}\n- reconnect = _throttle(() => this.openSocket('reconnecting'), 2000);\n+ reconnect: $Call<typeof _throttle, () => void, number> = _throttle(() => this.openSocket('reconnecting'), 2000);\ncomponentDidMount() {\nif (this.props.detectUnsupervisedBackgroundRef) {\n@@ -311,7 +311,7 @@ class Socket extends React.PureComponent<Props, State> {\n}\n}\n- render() {\n+ render(): React.Node {\n// It's important that APIRequestHandler get rendered first here. This is so\n// that it is registered with Redux first, so that its componentDidUpdate\n// processes before the other Handlers. This allows APIRequestHandler to\n@@ -354,7 +354,7 @@ class Socket extends React.PureComponent<Props, State> {\n);\n}\n- sendMessageWithoutID = (message: ClientSocketMessageWithoutID) => {\n+ sendMessageWithoutID: (message: ClientSocketMessageWithoutID) => number = message => {\nconst id = this.nextClientMessageID++;\n// These conditions all do the same thing and the runtime checks are only\n// necessary for Flow\n@@ -393,7 +393,7 @@ class Socket extends React.PureComponent<Props, State> {\n}\n}\n- receiveMessage = async (event: MessageEvent) => {\n+ receiveMessage:(event: MessageEvent) => Promise<void> = async event => {\nconst message = Socket.messageFromEvent(event);\nif (!message) {\nreturn;\n@@ -477,15 +477,15 @@ class Socket extends React.PureComponent<Props, State> {\n}\n};\n- addListener = (listener: SocketListener) => {\n+ addListener: (listener: SocketListener) => void = listener => {\nthis.listeners.add(listener);\n};\n- removeListener = (listener: SocketListener) => {\n+ removeListener: (listener: SocketListener) => void = listener => {\nthis.listeners.delete(listener);\n};\n- onClose = () => {\n+ onClose: () => void = () => {\nconst { status } = this.props.connection;\nthis.socket = null;\nthis.stopPing();\n@@ -612,7 +612,7 @@ class Socket extends React.PureComponent<Props, State> {\nthis.markSocketInitialized();\n}\n- initializeSocket = async (retriesLeft: number = 1) => {\n+ initializeSocket: (retriesLeft?: number) => Promise<void> = async (retriesLeft = 1) => {\ntry {\nawait this.sendInitialMessage();\n} catch (e) {\n@@ -682,7 +682,7 @@ class Socket extends React.PureComponent<Props, State> {\n} catch (e) {}\n}\n- setLateResponse = (messageID: number, isLate: boolean) => {\n+ setLateResponse: (messageID: number, isLate: boolean) => void = (messageID, isLate) => {\nthis.props.dispatch({\ntype: setLateResponseActionType,\npayload: { messageID, isLate },\n@@ -697,7 +697,7 @@ class Socket extends React.PureComponent<Props, State> {\n}\n}\n- detectUnsupervisedBackground = (alreadyClosed: boolean) => {\n+ detectUnsupervisedBackground: (alreadyClosed: boolean) => boolean = alreadyClosed => {\n// On native, sometimes the app is backgrounded without the proper callbacks\n// getting triggered. This leaves us in an incorrect state for two reasons:\n// (1) The connection is still considered to be active, causing API requests\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/update-handler.react.js", "new_path": "lib/socket/update-handler.react.js", "diff": "@@ -19,7 +19,7 @@ type Props = {|\n+addListener: (listener: SocketListener) => void,\n+removeListener: (listener: SocketListener) => void,\n|};\n-export default function UpdateHandler(props: Props) {\n+export default function UpdateHandler(props: Props): React.Node {\nconst { addListener, removeListener, sendMessage } = props;\nconst dispatch = useDispatch();\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 12/*: Fix socket export Flow types Summary: https://flow.org/en/docs/lang/types-first/ Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1708
129,187
26.03.2021 16:55:39
14,400
13cca2e952d834b1e270e8de74fb8119ffccca4b
RN0.64 16/*: Update react-hot-loader libdef Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "web/flow-typed/npm/react-hot-loader_v4.6.x.js", "new_path": "web/flow-typed/npm/react-hot-loader_v4.6.x.js", "diff": "-// flow-typed signature: 13db9b002bb52d52588a74ebc12f93e0\n-// flow-typed version: c6154227d1/react-hot-loader_v4.6.x/flow_>=v0.53.0 <=v0.103.x\n+// flow-typed signature: 8a7e73fee92a885e2d4c8f94329ddbe2\n+// flow-typed version: c6154227d1/react-hot-loader_v4.6.x/flow_>=v0.104.x\n// @flow\ndeclare module \"react-hot-loader\" {\n- declare type Module = {\n- id: string,\n- };\n+ declare type Module = { id: string, ... };\ndeclare type ErrorReporterProps = {|\nerror: Error,\n- errorInfo: { componentStack: string }\n+ errorInfo: { componentStack: string, ... }\n|}\ndeclare export type ContainerProps = {|\n@@ -22,7 +20,7 @@ declare module \"react-hot-loader\" {\ndeclare export function hot(module: Module): <T: React$ComponentType<any>>(\nComponent: T,\n- props?: $Diff<ContainerProps, { children: React$Element<any> }>\n+ props?: $Diff<ContainerProps, { children: React$Element<any>, ... }>\n) => T\ndeclare export function cold<T: React$ComponentType<any>>(component: T): T\n@@ -42,7 +40,7 @@ declare module \"react-hot-loader\" {\nignoreSFC: boolean,\nignoreComponents: boolean,\nerrorReporter: React$ComponentType<ErrorReporterProps>,\n- ErrorOverlay: React$ComponentType<{ errors: Array<ErrorReporterProps> }>,\n+ ErrorOverlay: React$ComponentType<{ errors: Array<ErrorReporterProps>, ... }>,\nonComponentRegister: (type: any, uniqueLocalName: string, fileName: string) => any,\nonComponentCreate: (type: any, displayName: string) => any,\n|}\n@@ -55,6 +53,6 @@ declare module \"react-hot-loader/root\" {\ndeclare export function hot<T: React$ComponentType<any>>(\nComponent: T,\n- props?: $Diff<ContainerProps, { children: React$Element<any> }>\n+ props?: $Diff<ContainerProps, { children: React$Element<any>, ... }>\n): T;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 16/*: Update react-hot-loader libdef Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1712
129,187
28.03.2021 01:13:12
14,400
71baeec0859d9b7ce2e3b9e99f6fa70592fe5d83
RN0.64 17/*: Update react-timeago to get new Flow types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "web/package.json", "new_path": "web/package.json", "diff": "\"react-router\": \"^5.2.0\",\n\"react-router-dom\": \"^5.2.0\",\n\"react-switch\": \"^5.0.1\",\n- \"react-timeago\": \"^4.4.0\",\n+ \"react-timeago\": \"^5.2.0\",\n\"redux\": \"^4.0.4\",\n\"redux-devtools-extension\": \"^2.13.2\",\n\"redux-thunk\": \"^2.2.0\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -14367,10 +14367,10 @@ react-test-renderer@17.0.1:\nreact-shallow-renderer \"^16.13.1\"\nscheduler \"^0.20.1\"\n-react-timeago@^4.4.0:\n- version \"4.4.0\"\n- resolved \"https://registry.yarnpkg.com/react-timeago/-/react-timeago-4.4.0.tgz#4520dd9ba63551afc4d709819f52b14b9343ba2b\"\n- integrity sha512-Zj8RchTqZEH27LAANemzMR2RpotbP2aMd+UIajfYMZ9KW4dMcViUVKzC7YmqfiqlFfz8B0bjDw2xUBjmcxDngA==\n+react-timeago@^5.2.0:\n+ version \"5.2.0\"\n+ resolved \"https://registry.yarnpkg.com/react-timeago/-/react-timeago-5.2.0.tgz#d655d40aa55e4fe08a92234481a6aea7f656ab5d\"\n+ integrity sha512-wCEEDGQHMdFh/PLp+Hj5vk9ZoC4KjQ5u0u6+KrrY9rny5LqJ2gZvNNEAS4mhSZDV1i7JLgQI5VQTAux7f+vj2w==\nreact@17.0.1:\nversion \"17.0.1\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 17/*: Update react-timeago to get new Flow types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1713
129,187
28.03.2021 14:54:15
14,400
c96788b131012cb066a07219ec0d11cd1ebcb16c
RN0.64 18/*: Type web RouterHistory and update related libdefs Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "server/flow-typed/npm/history_v4.x.x.js", "new_path": "server/flow-typed/npm/history_v4.x.x.js", "diff": "-// flow-typed signature: e461b9fe923a5f62ed607392b0742c02\n-// flow-typed version: c6154227d1/history_v4.x.x/flow_>=v0.25.x <=v0.103.x\n+// flow-typed signature: 58cc95d240510cd0f952113ab5fd1910\n+// flow-typed version: 72313e0b69/history_v4.x.x/flow_>=v0.104.x\n-declare module \"history/createBrowserHistory\" {\n- declare function Unblock(): void;\n+declare module 'history' {\n+ declare type Unregister = () => void;\n- declare export type Action = \"PUSH\" | \"REPLACE\" | \"POP\";\n+ declare export type Action = 'PUSH' | 'REPLACE' | 'POP';\n- declare export type BrowserLocation = {\n+ declare export type Location = {|\npathname: string,\nsearch: string,\nhash: string,\n- // Browser and Memory specific\n- state: {},\n+ state: { ... },\nkey: string,\n- };\n+ |};\n- declare interface IBrowserHistory {\n+ declare type History<HistoryLocation = Location> = {|\nlength: number,\n- location: BrowserLocation,\n+ location: HistoryLocation,\naction: Action,\n- push(path: string, state?: {}): void,\n- push(location: $Shape<BrowserLocation>): void,\n- replace(path: string, state?: {}): void,\n- replace(location: $Shape<BrowserLocation>): void,\n+ push: ((path: string, state?: { ... }) => void) &\n+ ((location: $Shape<HistoryLocation>) => void),\n+ replace: ((path: string, state?: { ... }) => void) &\n+ ((location: $Shape<HistoryLocation>) => void),\ngo(n: number): void,\ngoBack(): void,\ngoForward(): void,\n- listen: Function,\n- block(message: string): typeof Unblock,\n- block((location: BrowserLocation, action: Action) => string): typeof Unblock,\n- }\n-\n- declare export type BrowserHistory = IBrowserHistory;\n-\n- declare type HistoryOpts = {\n+ listen((location: HistoryLocation, action: Action) => void): Unregister,\n+ block(\n+ prompt:\n+ | string\n+ | boolean\n+ | ((location: HistoryLocation, action: Action) => string | false | void)\n+ ): Unregister,\n+ createHref(location: $Shape<HistoryLocation>): string,\n+ |};\n+\n+ declare export type BrowserHistory = History<>;\n+\n+ declare type BrowserHistoryOpts = {|\nbasename?: string,\nforceRefresh?: boolean,\ngetUserConfirmation?: (\nmessage: string,\n- callback: (willContinue: boolean) => void,\n+ callback: (willContinue: boolean) => void\n) => void,\n- };\n-\n- declare export default (opts?: HistoryOpts) => BrowserHistory;\n-}\n-\n-declare module \"history/createMemoryHistory\" {\n- declare function Unblock(): void;\n-\n- declare export type Action = \"PUSH\" | \"REPLACE\" | \"POP\";\n+ keyLength?: number,\n+ |};\n- declare export type MemoryLocation = {\n- pathname: string,\n- search: string,\n- hash: string,\n- // Browser and Memory specific\n- state: {},\n- key: string,\n- };\n+ declare function createBrowserHistory(\n+ opts?: BrowserHistoryOpts\n+ ): BrowserHistory;\n- declare interface IMemoryHistory {\n- length: number,\n- location: MemoryLocation,\n- action: Action,\n+ declare export type MemoryHistory = {|\n+ ...History<>,\nindex: number,\n- entries: Array<string>,\n- push(path: string, state?: {}): void,\n- push(location: $Shape<MemoryLocation>): void,\n- replace(path: string, state?: {}): void,\n- replace(location: $Shape<MemoryLocation>): void,\n- go(n: number): void,\n- goBack(): void,\n- goForward(): void,\n- // Memory only\n+ entries: Array<string | Location>,\ncanGo(n: number): boolean,\n- listen: Function,\n- block(message: string): typeof Unblock,\n- block((location: MemoryLocation, action: Action) => string): typeof Unblock,\n- }\n+ |};\n- declare export type MemoryHistory = IMemoryHistory;\n-\n- declare type HistoryOpts = {\n+ declare type MemoryHistoryOpts = {|\ninitialEntries?: Array<string>,\ninitialIndex?: number,\nkeyLength?: number,\ngetUserConfirmation?: (\nmessage: string,\n- callback: (willContinue: boolean) => void,\n+ callback: (willContinue: boolean) => void\n) => void,\n- };\n-\n- declare export default (opts?: HistoryOpts) => MemoryHistory;\n-}\n+ |};\n-declare module \"history/createHashHistory\" {\n- declare function Unblock(): void;\n+ declare function createMemoryHistory(opts?: MemoryHistoryOpts): MemoryHistory;\n- declare export type Action = \"PUSH\" | \"REPLACE\" | \"POP\";\n-\n- declare export type HashLocation = {\n- pathname: string,\n- search: string,\n- hash: string,\n- };\n-\n- declare interface IHashHistory {\n- length: number,\n- location: HashLocation,\n- action: Action,\n- push(path: string, state?: {}): void,\n- push(location: $Shape<HashLocation>): void,\n- replace(path: string, state?: {}): void,\n- replace(location: $Shape<HashLocation>): void,\n- go(n: number): void,\n- goBack(): void,\n- goForward(): void,\n- listen: Function,\n- block(message: string): typeof Unblock,\n- block((location: HashLocation, action: Action) => string): typeof Unblock,\n- push(path: string): void,\n- }\n+ declare export type HashLocation = {|\n+ ...Location,\n+ state: void,\n+ key: void,\n+ |};\n- declare export type HashHistory = IHashHistory;\n+ declare export type HashHistory = History<HashLocation>;\n- declare type HistoryOpts = {\n+ declare type HashHistoryOpts = {|\nbasename?: string,\n- hashType: \"slash\" | \"noslash\" | \"hashbang\",\n+ hashType: 'slash' | 'noslash' | 'hashbang',\ngetUserConfirmation?: (\nmessage: string,\n- callback: (willContinue: boolean) => void,\n+ callback: (willContinue: boolean) => void\n) => void,\n- };\n+ |};\n+\n+ declare function createHashHistory(opts?: HashHistoryOpts): HashHistory;\n+\n+ // PathUtils\n+ declare function parsePath(path: string): Location;\n+\n+ declare function createPath(location: $Shape<Location>): string;\n+\n+ // LocationUtils\n+ declare function locationsAreEqual(\n+ a: $Shape<Location>,\n+ b: $Shape<Location>\n+ ): boolean;\n- declare export default (opts?: HistoryOpts) => HashHistory;\n+ declare function createLocation(\n+ path: string | $Shape<Location>,\n+ state?: { ... },\n+ key?: string,\n+ currentLocation?: Location\n+ ): Location;\n}\n" }, { "change_type": "MODIFY", "old_path": "web/flow-typed/npm/history_v4.x.x.js", "new_path": "web/flow-typed/npm/history_v4.x.x.js", "diff": "-// flow-typed signature: e461b9fe923a5f62ed607392b0742c02\n-// flow-typed version: c6154227d1/history_v4.x.x/flow_>=v0.25.x <=v0.103.x\n+// flow-typed signature: 58cc95d240510cd0f952113ab5fd1910\n+// flow-typed version: 72313e0b69/history_v4.x.x/flow_>=v0.104.x\n-declare module \"history/createBrowserHistory\" {\n- declare function Unblock(): void;\n+declare module 'history' {\n+ declare type Unregister = () => void;\n- declare export type Action = \"PUSH\" | \"REPLACE\" | \"POP\";\n+ declare export type Action = 'PUSH' | 'REPLACE' | 'POP';\n- declare export type BrowserLocation = {\n+ declare export type Location = {|\npathname: string,\nsearch: string,\nhash: string,\n- // Browser and Memory specific\n- state: {},\n+ state: { ... },\nkey: string,\n- };\n+ |};\n- declare interface IBrowserHistory {\n+ declare type History<HistoryLocation = Location> = {|\nlength: number,\n- location: BrowserLocation,\n+ location: HistoryLocation,\naction: Action,\n- push(path: string, state?: {}): void,\n- push(location: $Shape<BrowserLocation>): void,\n- replace(path: string, state?: {}): void,\n- replace(location: $Shape<BrowserLocation>): void,\n+ push: ((path: string, state?: { ... }) => void) &\n+ ((location: $Shape<HistoryLocation>) => void),\n+ replace: ((path: string, state?: { ... }) => void) &\n+ ((location: $Shape<HistoryLocation>) => void),\ngo(n: number): void,\ngoBack(): void,\ngoForward(): void,\n- listen: Function,\n- block(message: string): typeof Unblock,\n- block((location: BrowserLocation, action: Action) => string): typeof Unblock,\n- }\n-\n- declare export type BrowserHistory = IBrowserHistory;\n-\n- declare type HistoryOpts = {\n+ listen((location: HistoryLocation, action: Action) => void): Unregister,\n+ block(\n+ prompt:\n+ | string\n+ | boolean\n+ | ((location: HistoryLocation, action: Action) => string | false | void)\n+ ): Unregister,\n+ createHref(location: $Shape<HistoryLocation>): string,\n+ |};\n+\n+ declare export type BrowserHistory = History<>;\n+\n+ declare type BrowserHistoryOpts = {|\nbasename?: string,\nforceRefresh?: boolean,\ngetUserConfirmation?: (\nmessage: string,\n- callback: (willContinue: boolean) => void,\n+ callback: (willContinue: boolean) => void\n) => void,\n- };\n-\n- declare export default (opts?: HistoryOpts) => BrowserHistory;\n-}\n-\n-declare module \"history/createMemoryHistory\" {\n- declare function Unblock(): void;\n-\n- declare export type Action = \"PUSH\" | \"REPLACE\" | \"POP\";\n+ keyLength?: number,\n+ |};\n- declare export type MemoryLocation = {\n- pathname: string,\n- search: string,\n- hash: string,\n- // Browser and Memory specific\n- state: {},\n- key: string,\n- };\n+ declare function createBrowserHistory(\n+ opts?: BrowserHistoryOpts\n+ ): BrowserHistory;\n- declare interface IMemoryHistory {\n- length: number,\n- location: MemoryLocation,\n- action: Action,\n+ declare export type MemoryHistory = {|\n+ ...History<>,\nindex: number,\n- entries: Array<string>,\n- push(path: string, state?: {}): void,\n- push(location: $Shape<MemoryLocation>): void,\n- replace(path: string, state?: {}): void,\n- replace(location: $Shape<MemoryLocation>): void,\n- go(n: number): void,\n- goBack(): void,\n- goForward(): void,\n- // Memory only\n+ entries: Array<string | Location>,\ncanGo(n: number): boolean,\n- listen: Function,\n- block(message: string): typeof Unblock,\n- block((location: MemoryLocation, action: Action) => string): typeof Unblock,\n- }\n+ |};\n- declare export type MemoryHistory = IMemoryHistory;\n-\n- declare type HistoryOpts = {\n+ declare type MemoryHistoryOpts = {|\ninitialEntries?: Array<string>,\ninitialIndex?: number,\nkeyLength?: number,\ngetUserConfirmation?: (\nmessage: string,\n- callback: (willContinue: boolean) => void,\n+ callback: (willContinue: boolean) => void\n) => void,\n- };\n-\n- declare export default (opts?: HistoryOpts) => MemoryHistory;\n-}\n+ |};\n-declare module \"history/createHashHistory\" {\n- declare function Unblock(): void;\n+ declare function createMemoryHistory(opts?: MemoryHistoryOpts): MemoryHistory;\n- declare export type Action = \"PUSH\" | \"REPLACE\" | \"POP\";\n-\n- declare export type HashLocation = {\n- pathname: string,\n- search: string,\n- hash: string,\n- };\n-\n- declare interface IHashHistory {\n- length: number,\n- location: HashLocation,\n- action: Action,\n- push(path: string, state?: {}): void,\n- push(location: $Shape<HashLocation>): void,\n- replace(path: string, state?: {}): void,\n- replace(location: $Shape<HashLocation>): void,\n- go(n: number): void,\n- goBack(): void,\n- goForward(): void,\n- listen: Function,\n- block(message: string): typeof Unblock,\n- block((location: HashLocation, action: Action) => string): typeof Unblock,\n- push(path: string): void,\n- }\n+ declare export type HashLocation = {|\n+ ...Location,\n+ state: void,\n+ key: void,\n+ |};\n- declare export type HashHistory = IHashHistory;\n+ declare export type HashHistory = History<HashLocation>;\n- declare type HistoryOpts = {\n+ declare type HashHistoryOpts = {|\nbasename?: string,\n- hashType: \"slash\" | \"noslash\" | \"hashbang\",\n+ hashType: 'slash' | 'noslash' | 'hashbang',\ngetUserConfirmation?: (\nmessage: string,\n- callback: (willContinue: boolean) => void,\n+ callback: (willContinue: boolean) => void\n) => void,\n- };\n+ |};\n+\n+ declare function createHashHistory(opts?: HashHistoryOpts): HashHistory;\n+\n+ // PathUtils\n+ declare function parsePath(path: string): Location;\n+\n+ declare function createPath(location: $Shape<Location>): string;\n+\n+ // LocationUtils\n+ declare function locationsAreEqual(\n+ a: $Shape<Location>,\n+ b: $Shape<Location>\n+ ): boolean;\n- declare export default (opts?: HistoryOpts) => HashHistory;\n+ declare function createLocation(\n+ path: string | $Shape<Location>,\n+ state?: { ... },\n+ key?: string,\n+ currentLocation?: Location\n+ ): Location;\n}\n" }, { "change_type": "MODIFY", "old_path": "web/router-history.js", "new_path": "web/router-history.js", "diff": "// @flow\n-import * as historyModule from 'history';\n+import * as HistoryModule from 'history';\n+import type { RouterHistory, LocationShape } from 'react-router';\nimport invariant from 'invariant';\n-const { createBrowserHistory } = historyModule;\n+const { createBrowserHistory } = HistoryModule;\ndeclare var baseURL: string;\n+type LocationType = LocationShape;\n+type HistoryObject = HistoryModule.History<LocationType> & RouterHistory;\n+\n// eslint-disable-next-line no-undef\n-const history = process.env.BROWSER\n- ? createBrowserHistory({ basename: baseURL })\n+const history: ?HistoryObject = process.env.BROWSER\n+ ? (createBrowserHistory({ basename: baseURL }): any)\n: null;\n-export default {\n+type History = {|\n+ +getHistoryObject: () => HistoryObject,\n+ +push: (location: string) => void,\n+ +replace: (location: string) => void,\n+|};\n+\n+const routerHistory: History = {\ngetHistoryObject: () => {\ninvariant(\nhistory,\n@@ -29,3 +39,5 @@ export default {\nreturn history.replace(location);\n},\n};\n+\n+export default routerHistory;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 18/*: Type web RouterHistory and update related libdefs Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1714
129,187
28.03.2021 15:55:43
14,400
923952b87acf37a6366c5c3368ff564c2fefcdc7
RN0.64 21/*: Fix server SQL types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "ADD", "old_path": null, "new_path": "server/flow-typed/npm/mysql_v2.x.x.js", "diff": "+// flow-typed signature: c19cdbb02c8406091b029b937c58fb76\n+// flow-typed version: eaa5f54644/mysql_v2.x.x/flow_>=v0.104.x\n+\n+// TODO: Events on event emitters\n+// TODO: Ssl structure type in ConnectionOptions\n+// TODO: PoolNamespace internal structure\n+// TODO: Packets internal structure\n+\n+declare module \"mysql\" {\n+ declare type TypeCastField = {\n+ db: string,\n+ table: string,\n+ name: string,\n+ type: string,\n+ length: number,\n+ string: () => string,\n+ buffer: () => Buffer,\n+ ...\n+ }\n+\n+ declare type ConnectionOptions = {\n+ host?: string,\n+ port?: number,\n+ localAddress?: string,\n+ socketPath?: string,\n+ user: string,\n+ password: string,\n+ database?: string,\n+ charset?: string,\n+ timezone?: string,\n+ connectTimeout?: number,\n+ stringifyObjects?: boolean,\n+ insecureAuth?: boolean,\n+ typeCast?: boolean | ((field: TypeCastField, next: () => mixed) => any),\n+ queryFormat?: (query: string, values: ?mixed, timezone: string) => string,\n+ supportBigNumbers?: boolean,\n+ bigNumberStrings?: boolean,\n+ dateStrings?: boolean | Array<string>,\n+ // Array form contains ids of packets for logging\n+ debug?: boolean | Array<string>,\n+ trace?: boolean,\n+ multipleStatements?: boolean,\n+ flags?: string,\n+ ssl?: string | {...},\n+ ...\n+ };\n+\n+ declare type QueryOptions = {\n+ sql: string,\n+ typeCast?: boolean | ((field: TypeCastField, next: () => mixed) => any),\n+ // string form is a separator used to produce column names\n+ nestTables?: boolean | string,\n+ values?: Array<mixed>,\n+ timeout?: number,\n+ ...\n+ } | string;\n+\n+ declare type QueryResults = Array<Object> & {\n+ insertId?: string | number,\n+ affectedRows?: number,\n+ changedRows?: number,\n+ ...\n+ };\n+\n+ declare type QueryField = {\n+ name: string,\n+ type: string,\n+ length: number,\n+ table: string,\n+ db: string,\n+ ...\n+ };\n+\n+ declare class Query extends events$EventEmitter {\n+ // readableStreamOptions declared in Flow /lib/node.js\n+ stream(options?: readableStreamOptions): stream$Readable;\n+ }\n+\n+ declare class Connection extends events$EventEmitter {\n+ threadId: number;\n+ connect(callback?: (error: ?Error) => *): void;\n+\n+ release(): void;\n+ destroy(): void;\n+\n+ end(callback?: (error: ?Error) => *): void;\n+\n+ query(\n+ sql: QueryOptions,\n+ values?: Array<mixed> | {...},\n+ callback?: QueryCallback\n+ ): Query;\n+ query(sql: QueryOptions, callback?: QueryCallback): Query;\n+\n+ changeUser(\n+ options: {\n+ user?: string,\n+ password?: string,\n+ charset?: string,\n+ database?: string,\n+ ...\n+ },\n+ callback: (error: ?Error) => *\n+ ): void;\n+\n+ beginTransaction(options: QueryOptions, callback: QueryCallback): void;\n+ beginTransaction(callback: QueryCallback): void;\n+ commit(options: QueryOptions, callback: QueryCallback): void;\n+ commit(callback: QueryCallback): void;\n+ rollback(options: QueryOptions, callback: QueryCallback): void;\n+ rollback(callback: QueryCallback): void;\n+\n+ ping(options: QueryOptions, callback: QueryCallback): void;\n+ ping(callback: QueryCallback): void;\n+\n+ escapeId(val: mixed, forbidQualified?: boolean): string;\n+ escape(val: mixed, stringifyObjects?: boolean, timeZone?: string): string;\n+ format(sql: string, valus: Array<mixed>): string;\n+ }\n+\n+ declare class Pool extends events$EventEmitter {\n+ getConnection(\n+ callback: (error: ?Error, connection?: Connection) => *\n+ ): void;\n+ end(callback?: (error: ?Error) => *): void;\n+ query(\n+ sql: QueryOptions,\n+ values?: Array<mixed>,\n+ callback?: QueryCallback\n+ ): Query;\n+ query(sql: QueryOptions, callback?: QueryCallback): Query;\n+\n+ escapeId(val: mixed, forbidQualified?: boolean): string;\n+ escape(val: mixed, stringifyObjects?: boolean, timeZone?: string): string;\n+ }\n+\n+ declare type PoolOptions = ConnectionOptions & {\n+ acquireTimeout?: number,\n+ connectionLimit?: number,\n+ waitForConnections?: boolean,\n+ queueLimit?: number,\n+ ...\n+ };\n+\n+ declare type PoolClusterSelector = \"RR\" | \"ORDER\" | \"RANDOM\";\n+\n+ declare type PoolClusterOptions = {\n+ defaultSelector?: PoolClusterSelector,\n+ canRetry?: boolean,\n+ removeNodeErrorCount?: number,\n+ restoreNodeTimeout?: number,\n+ ...\n+ };\n+\n+ declare type QueryCallback = (\n+ error: ?Error,\n+ results: QueryResults,\n+ fields?: Array<QueryField>\n+ ) => *;\n+\n+ declare class PoolCluster extends events$EventEmitter {\n+ add(config: PoolOptions | string): void;\n+ add(name: string, config: PoolOptions | string): void;\n+ remove(name: string): void;\n+\n+ getConnection(\n+ pattern: string | RegExp,\n+ selector: PoolClusterSelector,\n+ callback: (error: ?Error, connection?: Connection) => *\n+ ): void;\n+ getConnection(\n+ pattern: string | RegExp,\n+ callback: (error: ?Error, connection?: Connection) => *\n+ ): void;\n+ getConnection(\n+ callback: (error: ?Error, connection?: Connection) => *\n+ ): void;\n+\n+ // Truth to be told, of returns not a Pool, but PoolNamespace instance but it is the same for the most part\n+ of(pattern: string | RegExp, selector?: PoolClusterSelector): Pool;\n+\n+ end(callback?: (error: ?Error) => *): void;\n+ }\n+\n+ declare function escapeId(val: mixed, forbidQualified?: boolean): string;\n+ declare function escape(\n+ val: mixed,\n+ stringifyObjects?: boolean,\n+ timeZone?: string\n+ ): string;\n+ declare function format(sql: string, valus: Array<mixed>): string;\n+ declare function createConnection(\n+ options: ConnectionOptions | string\n+ ): Connection;\n+ declare function createPool(options: PoolOptions | string): Pool;\n+ declare function createPoolCluster(options?: PoolClusterOptions): PoolCluster;\n+ declare function raw(sql: string): { toSqlString: () => string, ... };\n+}\n" }, { "change_type": "MODIFY", "old_path": "server/src/creators/update-creator.js", "new_path": "server/src/creators/update-creator.js", "diff": "@@ -41,9 +41,9 @@ import { promiseAll } from 'lib/utils/promises';\nimport {\ndbQuery,\nSQL,\n- SQLStatement,\nmergeAndConditions,\n} from '../database/database';\n+import type { SQLStatementType } from '../database/types';\nimport { deleteUpdatesByConditions } from '../deleters/update-deleters';\nimport {\nfetchEntryInfos,\n@@ -280,7 +280,7 @@ async function createUpdates(\ninsertRows.push(insertRow);\n}\n- const deleteSQLConditions: SQLStatement[] = [];\n+ const deleteSQLConditions: SQLStatementType[] = [];\nfor (const [conditionKey, keyUpdateDatas] of keyedUpdateDatas) {\nconst deleteConditionByTarget: Map<?string, DeleteCondition> = new Map();\nfor (const updateData of keyUpdateDatas) {\n" }, { "change_type": "MODIFY", "old_path": "server/src/database/database.js", "new_path": "server/src/database/database.js", "diff": "import mysql from 'mysql2';\nimport mysqlPromise from 'mysql2/promise';\nimport SQL from 'sql-template-strings';\n+import type { QueryResults } from 'mysql';\nimport dbConfig from '../../secrets/db_config';\nimport { getScriptContext } from '../scripts/script-context';\nimport { connectionLimit, queryWarnTime } from './consts';\nimport DatabaseMonitor from './monitor';\n+import type { Pool, SQLOrString, SQLStatementType } from './types';\n-const SQLStatement = SQL.SQLStatement;\n-\n-export type QueryResult = [any[] & { insertId?: number }, any[]];\n+const SQLStatement: SQLStatementType = SQL.SQLStatement;\nlet pool, databaseMonitor;\n-function getPool() {\n+function getPool(): Pool {\nif (pool) {\nreturn pool;\n}\n@@ -30,12 +30,11 @@ function getPool() {\nreturn pool;\n}\n-type SQLOrString = SQLStatement | string;\nfunction appendSQLArray(\n- sql: SQLStatement,\n- sqlArray: $ReadOnlyArray<SQLStatement>,\n+ sql: SQLStatementType,\n+ sqlArray: $ReadOnlyArray<SQLStatementType>,\ndelimeter: SQLOrString,\n-) {\n+): SQLStatementType {\nif (sqlArray.length === 0) {\nreturn sql;\n}\n@@ -45,27 +44,27 @@ function appendSQLArray(\nreturn sql;\n}\nreturn rest.reduce(\n- (prev: SQLStatement, curr: SQLStatement) =>\n+ (prev: SQLStatementType, curr: SQLStatementType) =>\nprev.append(delimeter).append(curr),\nsql,\n);\n}\nfunction mergeConditions(\n- conditions: $ReadOnlyArray<SQLStatement>,\n- delimiter: SQLStatement,\n-) {\n+ conditions: $ReadOnlyArray<SQLStatementType>,\n+ delimiter: SQLStatementType,\n+): SQLStatementType {\nconst sql = SQL` (`;\nappendSQLArray(sql, conditions, delimiter);\nsql.append(SQL`) `);\nreturn sql;\n}\n-function mergeAndConditions(andConditions: $ReadOnlyArray<SQLStatement>) {\n+function mergeAndConditions(andConditions: $ReadOnlyArray<SQLStatementType>): SQLStatementType {\nreturn mergeConditions(andConditions, SQL` AND `);\n}\n-function mergeOrConditions(andConditions: $ReadOnlyArray<SQLStatement>) {\n+function mergeOrConditions(andConditions: $ReadOnlyArray<SQLStatementType>): SQLStatementType {\nreturn mergeConditions(andConditions, SQL` OR `);\n}\n@@ -74,13 +73,13 @@ function FakeSQLResult() {\nthis.insertId = -1;\n}\nFakeSQLResult.prototype = Array.prototype;\n-const fakeResult: any = new FakeSQLResult();\n+const fakeResult: QueryResults = (new FakeSQLResult(): any);\ntype QueryOptions = {|\n+triesLeft?: number,\n+multipleStatements?: boolean,\n|};\n-async function dbQuery(statement: SQLStatement, options?: QueryOptions) {\n+async function dbQuery(statement: SQLStatementType, options?: QueryOptions): Promise<QueryResults> {\nconst triesLeft = options?.triesLeft ?? 2;\nconst multipleStatements = options?.multipleStatements ?? false;\n@@ -107,7 +106,7 @@ async function dbQuery(statement: SQLStatement, options?: QueryOptions) {\nsql.startsWith('UPDATE'))\n) {\nconsole.log(rawSQL(statement));\n- return [fakeResult];\n+ return ([fakeResult]: any);\n}\nreturn await connection.query(statement);\n} catch (e) {\n@@ -125,7 +124,7 @@ async function dbQuery(statement: SQLStatement, options?: QueryOptions) {\n}\n}\n-function rawSQL(statement: SQLStatement) {\n+function rawSQL(statement: SQLStatementType): string {\nreturn mysql.format(statement.sql, statement.values);\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/database/monitor.js", "new_path": "server/src/database/monitor.js", "diff": "// @flow\nimport { queryWarnTime } from './consts';\n-\n-type Pool = {\n- +on: ('acquire' | 'connection' | 'enqueue' | 'release', () => mixed) => void,\n- +pool: {\n- +_connectionQueue: $ReadOnlyArray<mixed>,\n- ...\n- },\n- ...\n-};\n+import type { Pool } from './types';\nfunction countDecimals(num: number) {\nreturn 1 + (num === 0 ? 0 : Math.floor(Math.log10(num)));\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/src/database/types.js", "diff": "+// @flow\n+\n+import type { QueryResults } from 'mysql';\n+\n+export type Pool = {\n+ +on: ('acquire' | 'connection' | 'enqueue' | 'release', () => mixed) => void,\n+ +pool: {\n+ +_connectionQueue: $ReadOnlyArray<mixed>,\n+ ...\n+ },\n+ +query: (input: SQLOrString) => Promise<QueryResults>,\n+ +end: () => void,\n+ ...\n+};\n+\n+export type SQLStatementType = {|\n+ +text: string,\n+ +query: string,\n+ +sql: string,\n+ +name: string,\n+ +append: (statement: SQLStatementType | string | number) => SQLStatementType,\n+ +setName: (name: string) => SQLStatementType,\n+ +useBind: (value?: boolean) => SQLStatementType,\n+ +values: any[],\n+|};\n+\n+export type SQLOrString = SQLStatementType | string;\n" }, { "change_type": "MODIFY", "old_path": "server/src/deleters/cookie-deleters.js", "new_path": "server/src/deleters/cookie-deleters.js", "diff": "@@ -4,15 +4,11 @@ import invariant from 'invariant';\nimport { cookieLifetime } from 'lib/types/session-types';\n-import {\n- dbQuery,\n- SQL,\n- SQLStatement,\n- mergeOrConditions,\n-} from '../database/database';\n+import { dbQuery, SQL, mergeOrConditions } from '../database/database';\n+import type { SQLStatementType } from '../database/types';\nasync function deleteCookiesByConditions(\n- conditions: $ReadOnlyArray<SQLStatement>,\n+ conditions: $ReadOnlyArray<SQLStatementType>,\n) {\ninvariant(conditions.length > 0, 'no conditions specified');\nconst conditionClause = mergeOrConditions(conditions);\n" }, { "change_type": "MODIFY", "old_path": "server/src/deleters/update-deleters.js", "new_path": "server/src/deleters/update-deleters.js", "diff": "import invariant from 'invariant';\n-import {\n- dbQuery,\n- SQL,\n- SQLStatement,\n- mergeOrConditions,\n-} from '../database/database';\n+import { dbQuery, SQL, mergeOrConditions } from '../database/database';\n+import type { SQLStatementType } from '../database/types';\nimport type { Viewer } from '../session/viewer';\nasync function deleteUpdatesByConditions(\n- conditions: $ReadOnlyArray<SQLStatement>,\n+ conditions: $ReadOnlyArray<SQLStatementType>,\n) {\ninvariant(conditions.length > 0, 'no conditions specified');\nconst conditionClause = mergeOrConditions(conditions);\n" }, { "change_type": "MODIFY", "old_path": "server/src/fetchers/entry-fetchers.js", "new_path": "server/src/fetchers/entry-fetchers.js", "diff": "@@ -26,10 +26,10 @@ import { ServerError } from 'lib/utils/errors';\nimport {\ndbQuery,\nSQL,\n- SQLStatement,\nmergeAndConditions,\nmergeOrConditions,\n} from '../database/database';\n+import type { SQLStatementType } from '../database/types';\nimport type { Viewer } from '../session/viewer';\nimport { creationString } from '../utils/idempotent';\nimport { checkIfThreadIsBlocked } from './thread-permission-fetchers';\n@@ -84,7 +84,7 @@ async function fetchEntryInfosByID(\nfunction sqlConditionForCalendarQuery(\ncalendarQuery: CalendarQuery,\n-): ?SQLStatement {\n+): ?SQLStatementType {\nconst { filters, startDate, endDate } = calendarQuery;\nconst conditions = [];\n@@ -113,7 +113,7 @@ async function fetchEntryInfos(\n): Promise<FetchEntryInfosBase> {\nconst queryConditions = calendarQueries\n.map(sqlConditionForCalendarQuery)\n- .filter(condition => condition);\n+ .filter(Boolean);\nif (queryConditions.length === 0) {\nreturn { rawEntryInfos: [] };\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/fetchers/thread-fetchers.js", "new_path": "server/src/fetchers/thread-fetchers.js", "diff": "@@ -12,7 +12,8 @@ import {\n} from 'lib/types/thread-types';\nimport { ServerError } from 'lib/utils/errors';\n-import { dbQuery, SQL, SQLStatement } from '../database/database';\n+import { dbQuery, SQL } from '../database/database';\n+import type { SQLStatementType } from '../database/types';\nimport type { Viewer } from '../session/viewer';\ntype FetchServerThreadInfosResult = {|\n@@ -20,7 +21,7 @@ type FetchServerThreadInfosResult = {|\n|};\nasync function fetchServerThreadInfos(\n- condition?: SQLStatement,\n+ condition?: SQLStatementType,\n): Promise<FetchServerThreadInfosResult> {\nconst whereClause = condition ? SQL`WHERE `.append(condition) : '';\n@@ -104,7 +105,7 @@ export type FetchThreadInfosResult = {|\nasync function fetchThreadInfos(\nviewer: Viewer,\n- condition?: SQLStatement,\n+ condition?: SQLStatementType,\n): Promise<FetchThreadInfosResult> {\nconst serverResult = await fetchServerThreadInfos(condition);\nreturn rawThreadInfosFromServerThreadInfos(viewer, serverResult);\n" }, { "change_type": "MODIFY", "old_path": "server/src/fetchers/update-fetchers.js", "new_path": "server/src/fetchers/update-fetchers.js", "diff": "@@ -15,14 +15,15 @@ import {\ntype FetchUpdatesResult,\nfetchUpdateInfosWithRawUpdateInfos,\n} from '../creators/update-creator';\n-import { dbQuery, SQL, SQLStatement } from '../database/database';\n+import { dbQuery, SQL } from '../database/database';\n+import type { SQLStatementType } from '../database/types';\nimport type { Viewer } from '../session/viewer';\nconst defaultUpdateFetchResult = { updateInfos: [], userInfos: {} };\nasync function fetchUpdateInfosWithQuery(\nviewerInfo: ViewerInfo,\n- query: SQLStatement,\n+ query: SQLStatementType,\n): Promise<FetchUpdatesResult> {\nif (!viewerInfo.viewer.loggedIn) {\nthrow new ServerError('not_logged_in');\n" }, { "change_type": "MODIFY", "old_path": "server/src/push/rescind.js", "new_path": "server/src/push/rescind.js", "diff": "@@ -8,14 +8,15 @@ import { threadPermissions } from 'lib/types/thread-types';\nimport { promiseAll } from 'lib/utils/promises';\nimport createIDs from '../creators/id-creator';\n-import { dbQuery, SQL, SQLStatement } from '../database/database';\n+import { dbQuery, SQL } from '../database/database';\nimport { getAPNsNotificationTopic } from './providers';\n+import type { SQLStatementType } from '../database/types';\nimport { apnPush, fcmPush } from './utils';\n// Returns list of deviceTokens that have been updated\nasync function rescindPushNotifs(\n- notifCondition: SQLStatement,\n- inputCountCondition?: SQLStatement,\n+ notifCondition: SQLStatementType,\n+ inputCountCondition?: SQLStatementType,\n): Promise<string[]> {\nconst notificationExtractString = `$.${threadSubscriptions.home}`;\nconst visPermissionExtractString = `$.${threadPermissions.VISIBLE}.value`;\n" }, { "change_type": "MODIFY", "old_path": "server/src/scripts/merge-users.js", "new_path": "server/src/scripts/merge-users.js", "diff": "@@ -5,7 +5,8 @@ import type { ServerThreadInfo } from 'lib/types/thread-types';\nimport { type UpdateData, updateTypes } from 'lib/types/update-types';\nimport { createUpdates } from '../creators/update-creator';\n-import { dbQuery, SQL, SQLStatement } from '../database/database';\n+import { dbQuery, SQL } from '../database/database';\n+import type { SQLStatementType } from '../database/types';\nimport { deleteAccount } from '../deleters/account-deleters';\nimport { fetchServerThreadInfos } from '../fetchers/thread-fetchers';\nimport { createScriptViewer } from '../session/scripts';\n@@ -141,7 +142,7 @@ async function mergeUsers(\n}\ntype ReplaceUserResult = {|\n- sql: ?SQLStatement,\n+ sql: ?SQLStatementType,\nupdateDatas: UpdateData[],\n|};\nasync function replaceUser(\n" }, { "change_type": "MODIFY", "old_path": "server/src/updaters/activity-updaters.js", "new_path": "server/src/updaters/activity-updaters.js", "diff": "@@ -17,12 +17,8 @@ import { updateTypes } from 'lib/types/update-types';\nimport { ServerError } from 'lib/utils/errors';\nimport { createUpdates } from '../creators/update-creator';\n-import {\n- dbQuery,\n- SQL,\n- mergeOrConditions,\n- SQLStatement,\n-} from '../database/database';\n+import { dbQuery, SQL, mergeOrConditions } from '../database/database';\n+import type { SQLStatementType } from '../database/types';\nimport { deleteActivityForViewerSession } from '../deleters/activity-deleters';\nimport {\ncheckThread,\n@@ -44,14 +40,14 @@ type ThreadStatus =\n+threadID: string,\n+newLastReadMessage: number,\n+curLastReadMessage: number,\n- +rescindCondition: SQLStatement,\n+ +rescindCondition: SQLStatementType,\n|}\n| {|\n+focusActive: false,\n+threadID: string,\n+newLastReadMessage: ?number,\n+curLastReadMessage: number,\n- +rescindCondition: ?SQLStatement,\n+ +rescindCondition: ?SQLStatementType,\n+newerMessageFromOtherAuthor: boolean,\n|};\nasync function activityUpdater(\n@@ -460,7 +456,7 @@ async function setThreadUnreadStatus(\nasync function rescindAndUpdateBadgeCounts(\nviewer: Viewer,\n- rescindCondition: ?SQLStatement,\n+ rescindCondition: ?SQLStatementType,\nbadgeCountUpdateSource: ?(\n| 'activity_update'\n| 'mark_as_unread'\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 21/*: Fix server SQL types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1717
129,187
28.03.2021 21:58:45
14,400
b0a5a382d1ed41d74c1ce14537b9c2574aa302d9
RN0.64 22/*: Add rereadable-stream libdef Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "ADD", "old_path": null, "new_path": "server/flow-typed/npm/rereadable-stream_vx.x.x.js", "diff": "+// flow-typed signature: d2fab7bd2a9cee86a71d4dbf7d7d6fbc\n+// flow-typed version: <<STUB>>/rereadable-stream_v1.4.5/flow_v0.137.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'rereadable-stream'\n+ *\n+ * Fill this stub out by replacing all the `any` types.\n+ *\n+ * Once filled out, we encourage you to share your work with the\n+ * community by sending a pull request to:\n+ * https://github.com/flowtype/flow-typed\n+ */\n+\n+declare module 'rereadable-stream' {\n+ declare type ReReadableOptions = { length: number, ... } & writableStreamOptions;\n+ declare export class ReReadable extends stream$Writable {\n+ constructor(options?: ReReadableOptions): this;\n+ tail(count: number): stream$Readable;\n+ rewind(): stream$Readable;\n+ }\n+}\n+\n+/**\n+ * We include stubs for each file inside this npm package in case you need to\n+ * require those files directly. Feel free to delete any files that aren't\n+ * needed.\n+ */\n+\n+\n+// Filename aliases\n+declare module 'rereadable-stream/index' {\n+ declare module.exports: $Exports<'rereadable-stream'>;\n+}\n+declare module 'rereadable-stream/index.js' {\n+ declare module.exports: $Exports<'rereadable-stream'>;\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 22/*: Add rereadable-stream libdef Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1718
129,187
19.04.2021 21:25:47
14,400
d462bc6f9a5316e3b271d1e625ca79b7cd574264
RN0.64 26/*: Fix up message types in message-fetchers.js code Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "server/src/fetchers/message-fetchers.js", "new_path": "server/src/fetchers/message-fetchers.js", "diff": "@@ -10,6 +10,8 @@ import { messageSpecs } from 'lib/shared/messages/message-specs';\nimport { notifCollapseKeyForRawMessageInfo } from 'lib/shared/notif-utils';\nimport {\ntype RawMessageInfo,\n+ type RawComposableMessageInfo,\n+ type RawRobotextMessageInfo,\nmessageTypes,\ntype MessageType,\nassertMessageType,\n@@ -151,7 +153,7 @@ type MessageSQLResult = $ReadOnlyArray<{|\n|}>;\nfunction parseMessageSQLResult(\nrows: $ReadOnlyArray<Object>,\n- derivedMessages: $ReadOnlyMap<string, RawMessageInfo>,\n+ derivedMessages: $ReadOnlyMap<string, RawComposableMessageInfo | RawRobotextMessageInfo>,\nviewer?: Viewer,\n): MessageSQLResult {\nconst rowsByID = new Map();\n@@ -202,7 +204,7 @@ function mostRecentRowType(rows: $ReadOnlyArray<Object>): MessageType {\nfunction rawMessageInfoFromRows(\nrows: $ReadOnlyArray<Object>,\nviewer?: Viewer,\n- derivedMessages: $ReadOnlyMap<string, RawMessageInfo>,\n+ derivedMessages: $ReadOnlyMap<string, RawComposableMessageInfo | RawRobotextMessageInfo>,\n): ?RawMessageInfo {\nconst type = mostRecentRowType(rows);\nconst messageSpec = messageSpecs[type];\n@@ -211,6 +213,10 @@ function rawMessageInfoFromRows(\nconst media = rows.filter(row => row.uploadID).map(mediaFromRow);\nconst [row] = rows;\nconst localID = localIDFromCreationString(viewer, row.creation);\n+ invariant(\n+ messageSpec.rawMessageInfoFromRow,\n+ `multimedia message spec should have rawMessageInfoFromRow`,\n+ );\nreturn messageSpec.rawMessageInfoFromRow(row, {\nmedia,\nderivedMessages,\n@@ -222,7 +228,7 @@ function rawMessageInfoFromRows(\nconst localID = localIDFromCreationString(viewer, row.creation);\ninvariant(\nmessageSpec.rawMessageInfoFromRow,\n- `unrecognized messageType ${type}`,\n+ `message spec ${type} should have rawMessageInfoFromRow`,\n);\nreturn messageSpec.rawMessageInfoFromRow(row, { derivedMessages, localID });\n}\n@@ -539,7 +545,7 @@ async function fetchMessageRowsByIDs(messageIDs: $ReadOnlyArray<string>) {\nasync function fetchDerivedMessages(\nrows: $ReadOnlyArray<Object>,\nviewer?: Viewer,\n-): Promise<$ReadOnlyMap<string, RawMessageInfo>> {\n+): Promise<$ReadOnlyMap<string, RawComposableMessageInfo | RawRobotextMessageInfo>> {\nconst requiredIDs = new Set<string>();\nfor (const row of rows) {\nif (row.type === messageTypes.SIDEBAR_SOURCE) {\n@@ -548,7 +554,7 @@ async function fetchDerivedMessages(\n}\n}\n- const messagesByID = new Map<string, RawMessageInfo>();\n+ const messagesByID = new Map<string, RawComposableMessageInfo | RawRobotextMessageInfo>();\nif (requiredIDs.size === 0) {\nreturn messagesByID;\n}\n@@ -559,6 +565,10 @@ async function fetchDerivedMessages(\nfor (const message of messages) {\nconst { rawMessageInfo } = message;\nif (rawMessageInfo.id) {\n+ invariant(\n+ rawMessageInfo.type !== messageTypes.SIDEBAR_SOURCE,\n+ 'SIDEBAR_SOURCE should not point to a SIDEBAR_SOURCE',\n+ );\nmessagesByID.set(rawMessageInfo.id, rawMessageInfo);\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 26/*: Fix up message types in message-fetchers.js code Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1722
129,187
19.04.2021 21:27:45
14,400
0490ee5b7110ace52e8e15224a9d9882f382d01f
RN0.64 29/*: Partially type nodemailer package Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "server/src/emails/sendmail.js", "new_path": "server/src/emails/sendmail.js", "diff": "import nodemailer from 'nodemailer';\n-const sendmail = nodemailer.createTransport({ sendmail: true });\n+type MailInfo = {\n+ +from: string,\n+ +to: string,\n+ +subject: string,\n+ +html: string,\n+ ...\n+};\n+type Transport = {\n+ +sendMail: (info: MailInfo) => Promise<mixed>,\n+ ...\n+};\n+\n+const sendmail: Transport = nodemailer.createTransport({ sendmail: true });\nexport default sendmail;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 29/*: Partially type nodemailer package Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1725
129,187
19.04.2021 21:28:42
14,400
168590bdc137e845ad47c69c8aaea729855b3488
RN0.64 30/*: Fix remaining server export Flow types Summary: Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "server/src/creators/thread-creator.js", "new_path": "server/src/creators/thread-creator.js", "diff": "@@ -51,7 +51,7 @@ import type { UpdatesForCurrentSession } from './update-creator';\nconst { commbot } = bots;\n-const privateThreadDescription =\n+const privateThreadDescription: string =\n'This is your private thread, ' +\n'where you can set reminders and jot notes in private!';\n" }, { "change_type": "MODIFY", "old_path": "server/src/database/monitor.js", "new_path": "server/src/database/monitor.js", "diff": "@@ -9,8 +9,8 @@ function countDecimals(num: number) {\nclass DatabaseMonitor {\npool: Pool;\n- activeQueries = 0;\n- lastDecimalCount = 1;\n+ activeQueries: number = 0;\n+ lastDecimalCount: number = 1;\nconstructor(pool: Pool) {\nthis.pool = pool;\n@@ -19,15 +19,15 @@ class DatabaseMonitor {\npool.on('enqueue', this.onEnqueue);\n}\n- get queuedQueries() {\n+ get queuedQueries(): number {\nreturn this.pool.pool._connectionQueue.length;\n}\n- get outstandingQueries() {\n+ get outstandingQueries(): number {\nreturn this.activeQueries + this.queuedQueries;\n}\n- countOutstandingQueries() {\n+ countOutstandingQueries(): number {\nconst count = this.outstandingQueries;\nconst decimalCount = countDecimals(count);\nif (decimalCount > this.lastDecimalCount) {\n@@ -41,21 +41,21 @@ class DatabaseMonitor {\nreturn count;\n}\n- onAcquire = () => {\n+ onAcquire: () => void = () => {\nthis.activeQueries += 1;\nthis.countOutstandingQueries();\n};\n- onRelease = () => {\n+ onRelease: () => void = () => {\nthis.activeQueries -= 1;\nthis.countOutstandingQueries();\n};\n- onEnqueue = () => {\n+ onEnqueue: () => void = () => {\nthis.countOutstandingQueries();\n};\n- reportLaggingQuery = (query: string) => {\n+ reportLaggingQuery: (query: string) => void = query => {\nconst count = this.countOutstandingQueries();\nconsole.log(\n`a query is taking more than ${queryWarnTime}ms to execute. ` +\n" }, { "change_type": "MODIFY", "old_path": "server/src/emails/template.react.js", "new_path": "server/src/emails/template.react.js", "diff": "// @flow\n-import React from 'react';\n-import * as React2 from 'react';\n+import * as React from 'react';\nimport { Email, Box } from 'react-html-email';\nconst css = `\n@@ -10,10 +9,10 @@ const css = `\n}`.trim();\ntype Props = {|\n- title: string,\n- children: React2.Node,\n+ +title: string,\n+ +children: React.Node,\n|};\n-function Template(props: Props) {\n+function Template(props: Props): React.Node {\nreturn (\n<Email title={props.title} headCSS={css} align=\"left\" width=\"100%\">\n<Box align=\"left\" cellSpacing={10}>\n" }, { "change_type": "MODIFY", "old_path": "server/src/fetchers/relationship-fetchers.js", "new_path": "server/src/fetchers/relationship-fetchers.js", "diff": "// @flow\n+import type { RelationshipErrors } from 'lib/types/relationship-types';\n+\nimport _groupBy from 'lodash/fp/groupBy';\nimport { undirectedStatus, directedStatus } from 'lib/types/relationship-types';\n@@ -16,10 +18,14 @@ type UserRelationshipOperations = {\n[string]: $ReadOnlyArray<RelationshipOperation>,\n};\n+type UserRelationshipOperationsResult = {|\n+ +errors: RelationshipErrors,\n+ +userRelationshipOperations: UserRelationshipOperations,\n+|};\nasync function fetchFriendRequestRelationshipOperations(\nviewer: Viewer,\nuserIDs: string[],\n-) {\n+): Promise<UserRelationshipOperationsResult> {\nconst query = SQL`\nSELECT user1, user2, status\nFROM relationships_directed\n@@ -40,7 +46,7 @@ async function fetchFriendRequestRelationshipOperations(\nresult,\n);\n- const errors = {};\n+ const errors: RelationshipErrors = {};\nconst userRelationshipOperations: UserRelationshipOperations = {};\nfor (const userID in relationshipsByUserId) {\nconst relationships = relationshipsByUserId[userID];\n" }, { "change_type": "MODIFY", "old_path": "server/src/fetchers/thread-fetchers.js", "new_path": "server/src/fetchers/thread-fetchers.js", "diff": "@@ -201,7 +201,7 @@ async function determineThreadAncestry(\nfunction getContainingThreadID(\nparentThreadInfo: ?ServerThreadInfo,\nthreadType: ThreadType,\n-) {\n+): ?string {\nif (!parentThreadInfo) {\nreturn null;\n}\n@@ -214,7 +214,7 @@ function getContainingThreadID(\nreturn parentThreadInfo.containingThreadID;\n}\n-function getCommunity(parentThreadInfo: ?ServerThreadInfo) {\n+function getCommunity(parentThreadInfo: ?ServerThreadInfo): ?string {\nif (!parentThreadInfo) {\nreturn null;\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/fetchers/thread-permission-fetchers.js", "new_path": "server/src/fetchers/thread-permission-fetchers.js", "diff": "@@ -169,7 +169,7 @@ async function checkIfThreadIsBlocked(\nviewer: Viewer,\nthreadID: string,\npermission: ThreadPermission,\n-) {\n+): Promise<boolean> {\nconst disabledThreadIDs = await checkThreadsFrozen(\nviewer,\n[permission],\n" }, { "change_type": "MODIFY", "old_path": "server/src/fetchers/upload-fetchers.js", "new_path": "server/src/fetchers/upload-fetchers.js", "diff": "@@ -76,7 +76,7 @@ async function getUploadSize(id: string, secret: string): Promise<number> {\nreturn length;\n}\n-function getUploadURL(id: string, secret: string) {\n+function getUploadURL(id: string, secret: string): string {\nreturn `${baseDomain}${basePath}upload/${id}/${secret}`;\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/handlers.js", "new_path": "server/src/responders/handlers.js", "diff": "@@ -27,7 +27,7 @@ export type UploadResponder = (viewer: Viewer, req: $Request) => Promise<*>;\nfunction jsonHandler(\nresponder: JSONResponder,\nexpectCookieInvalidation: boolean,\n-) {\n+): (req: $Request, res: $Response) => Promise<void> {\nreturn async (req: $Request, res: $Response) => {\nlet viewer;\ntry {\n@@ -49,7 +49,9 @@ function jsonHandler(\n};\n}\n-function downloadHandler(responder: DownloadResponder) {\n+function downloadHandler(\n+ responder: DownloadResponder,\n+): (req: $Request, res: $Response) => Promise<void> {\nreturn async (req: $Request, res: $Response) => {\ntry {\nconst viewer = await fetchViewerForJSONRequest(req);\n@@ -99,7 +101,9 @@ async function handleException(\nres.json(result);\n}\n-function htmlHandler(responder: HTMLResponder) {\n+function htmlHandler(\n+ responder: HTMLResponder,\n+): (req: $Request, res: $Response) => Promise<void> {\nreturn async (req: $Request, res: $Response) => {\ntry {\nconst viewer = await fetchViewerForHomeRequest(req);\n@@ -115,7 +119,9 @@ function htmlHandler(responder: HTMLResponder) {\n};\n}\n-function uploadHandler(responder: UploadResponder) {\n+function uploadHandler(\n+ responder: UploadResponder,\n+): (req: $Request, res: $Response) => Promise<void> {\nreturn async (req: $Request, res: $Response) => {\nlet viewer;\ntry {\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/utils.js", "new_path": "server/src/responders/utils.js", "diff": "// @flow\nfunction getMessageForException(\n- error: Error & { sqlMessage?: string },\n+ error: Error & { sqlMessage?: string, ... },\n): string {\nreturn error.sqlMessage !== null && error.sqlMessage !== undefined\n? 'database error'\n" }, { "change_type": "MODIFY", "old_path": "server/src/session/viewer.js", "new_path": "server/src/session/viewer.js", "diff": "@@ -9,6 +9,7 @@ import {\ntype CookieSource,\ntype SessionIdentifierType,\ncookieTypes,\n+ type CookieType,\nsessionIdentifierTypes,\n} from 'lib/types/session-types';\nimport { ServerError } from 'lib/utils/errors';\n@@ -60,8 +61,8 @@ export type ViewerData = UserViewerData | AnonymousViewerData;\nclass Viewer {\ndata: ViewerData;\n- sessionChanged = false;\n- cookieInvalidated = false;\n+ sessionChanged: boolean = false;\n+ cookieInvalidated: boolean = false;\ninitialCookieName: string;\ncachedTimeZone: ?string;\n@@ -70,11 +71,11 @@ class Viewer {\nthis.initialCookieName = Viewer.cookieNameFromViewerData(data);\n}\n- static cookieNameFromViewerData(data: ViewerData) {\n+ static cookieNameFromViewerData(data: ViewerData): CookieType {\nreturn data.loggedIn ? cookieTypes.USER : cookieTypes.ANONYMOUS;\n}\n- getData() {\n+ getData(): ViewerData {\nreturn this.data;\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/shared/focused-times.js", "new_path": "server/src/shared/focused-times.js", "diff": "@@ -5,14 +5,14 @@ import { pingFrequency } from 'lib/shared/timeouts';\n// If the time column for a given entry in the focused table has a time later\n// than this, then that entry is considered current, and consequently the thread\n// in question is considered in focus.\n-function earliestFocusedTimeConsideredCurrent() {\n+function earliestFocusedTimeConsideredCurrent(): number {\nreturn Date.now() - pingFrequency - 1500;\n}\n// If the time column for a given entry in the focused table has a time earlier\n// than this, then that entry is considered expired, and consequently we will\n// remove it from the table in the nightly cronjob.\n-function earliestFocusedTimeConsideredExpired() {\n+function earliestFocusedTimeConsideredExpired(): number {\nreturn Date.now() - pingFrequency * 2 - 1500;\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/socket/redis.js", "new_path": "server/src/socket/redis.js", "diff": "@@ -43,7 +43,7 @@ class RedisPublisher {\nthis.pub.unref();\n}\n}\n-const publisher = new RedisPublisher();\n+const publisher: RedisPublisher = new RedisPublisher();\ntype OnMessage = (message: RedisMessage) => void | Promise<void>;\nclass RedisSubscriber {\n@@ -77,7 +77,7 @@ class RedisSubscriber {\n}\n}\n- onMessage = (channel: string, messageString: string) => {\n+ onMessage: (channel: string, messageString: string) => void = (channel, messageString) => {\nconst message = RedisSubscriber.messageFromString(messageString);\nif (!message) {\nreturn;\n" }, { "change_type": "MODIFY", "old_path": "server/src/uploads/uploads.js", "new_path": "server/src/uploads/uploads.js", "diff": "// @flow\n-import type { $Request, $Response } from 'express';\n+import type { $Request, $Response, Middleware } from 'express';\nimport invariant from 'invariant';\nimport multer from 'multer';\nimport { Readable } from 'stream';\n@@ -23,7 +23,7 @@ import type { Viewer } from '../session/viewer';\nimport { validateAndConvert } from './media-utils';\nconst upload = multer();\n-const multerProcessor = upload.array('multimedia');\n+const multerProcessor: Middleware<> = upload.array('multimedia');\ntype MulterFile = {|\nfieldname: string,\n@@ -39,7 +39,7 @@ type MultimediaUploadResult = {|\n|};\nasync function multimediaUploadResponder(\nviewer: Viewer,\n- req: $Request & { files?: $ReadOnlyArray<MulterFile> },\n+ req: $Request & { files?: $ReadOnlyArray<MulterFile>, ... },\n): Promise<MultimediaUploadResult> {\nconst { files, body } = req;\nif (!files || !body || typeof body !== 'object') {\n" }, { "change_type": "MODIFY", "old_path": "server/src/utils/depth-queue.js", "new_path": "server/src/utils/depth-queue.js", "diff": "class DepthQueue<T> {\ndepthQueues: Map<number, Map<string, T>> = new Map();\n- maxEnqueuedDepth = -1;\n- maxDequeuedDepth = -1;\n+ maxEnqueuedDepth: number = -1;\n+ maxDequeuedDepth: number = -1;\ngetDepth: (a: T) => number;\ngetKey: (a: T) => string;\nmergeFunction: (a: T, b: T) => T;\n" }, { "change_type": "MODIFY", "old_path": "server/src/utils/idempotent.js", "new_path": "server/src/utils/idempotent.js", "diff": "import type { Viewer } from '../session/viewer';\n-function creationString(viewer: Viewer, localID: string) {\n+function creationString(viewer: Viewer, localID: string): string {\nreturn `${viewer.session}|${localID}`;\n}\nfunction localIDFromCreationString(\nviewer: ?Viewer,\nourCreationString: ?string,\n-) {\n+): ?string {\nif (!ourCreationString || !viewer || !viewer.hasSessionInfo) {\nreturn null;\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/utils/relationship-changeset.js", "new_path": "server/src/utils/relationship-changeset.js", "diff": "@@ -12,7 +12,7 @@ type RelationshipStatus = 'existing' | 'potentially_missing';\nclass RelationshipChangeset {\nrelationships: Map<string, RelationshipStatus> = new Map();\n- finalized = false;\n+ finalized: boolean = false;\nstatic _getKey(userA: string, userB: string): string {\nconst [user1, user2] = sortIDs(userA, userB);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 30/*: Fix remaining server export Flow types Summary: https://flow.org/en/docs/lang/types-first/ Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1726
129,187
09.07.2021 11:37:41
14,400
9d04079f71977dec82acfb498d651f5f389d348f
RN0.64 31/*: Fix navigateToSidebar type Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/sidebar-navigation.js", "new_path": "native/chat/sidebar-navigation.js", "diff": "@@ -7,27 +7,17 @@ import type { AppNavigationProp } from '../navigation/app-navigator.react';\nimport type { TooltipRoute } from '../navigation/tooltip.react';\nimport { createNavigateToThreadAction } from './message-list-types';\nimport { getSidebarThreadInfo } from './utils';\n+import type { MessageTooltipRouteNames } from '../navigation/route-names';\n-function navigateToSidebar(\n- route:\n- | TooltipRoute<'RobotextMessageTooltipModal'>\n- | TooltipRoute<'TextMessageTooltipModal'>\n- | TooltipRoute<'MultimediaMessageTooltipModal'>,\n+function navigateToSidebar<RouteName: MessageTooltipRouteNames>(\n+ route: TooltipRoute<RouteName>,\ndispatchFunctions: DispatchFunctions,\nbindServerCall: <F>(serverCall: ActionFunc<F>) => F,\ninputState: ?InputState,\n- navigation:\n- | AppNavigationProp<'RobotextMessageTooltipModal'>\n- | AppNavigationProp<'TextMessageTooltipModal'>\n- | AppNavigationProp<'MultimediaMessageTooltipModal'>,\n+ navigation: AppNavigationProp<RouteName>,\nviewerID: ?string,\n) {\nconst threadInfo = getSidebarThreadInfo(route.params.item, viewerID);\n- // Necessary for Flow...\n- // eslint-disable-next-line no-empty\n- if (route.name === 'RobotextMessageTooltipModal') {\n- }\n-\nnavigation.navigate(createNavigateToThreadAction({ threadInfo }));\n}\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/route-names.js", "new_path": "native/navigation/route-names.js", "diff": "@@ -79,6 +79,11 @@ export type RootParamList = {|\n+ImagePasteModal: ImagePasteModalParams,\n|};\n+export type MessageTooltipRouteNames =\n+ | typeof RobotextMessageTooltipModalRouteName\n+ | typeof MultimediaMessageTooltipModalRouteName\n+ | typeof TextMessageTooltipModalRouteName;\n+\nexport type TooltipModalParamList = {|\n+MultimediaMessageTooltipModal: MultimediaMessageTooltipModalParams,\n+TextMessageTooltipModal: TextMessageTooltipModalParams,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 31/*: Fix navigateToSidebar type Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1727
129,187
13.07.2021 16:32:23
14,400
1968e8dbc733030ad35fbda76615a93e7aba96e0
RN0.64 36/*: Fix native simple-markdown types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/markdown/rules.react.js", "new_path": "native/markdown/rules.react.js", "diff": "@@ -15,7 +15,7 @@ import MarkdownLink from './markdown-link.react';\nimport { getMarkdownStyles } from './styles';\nexport type MarkdownRules = {|\n- +simpleMarkdownRules: SimpleMarkdown.ParserRules,\n+ +simpleMarkdownRules: SharedMarkdown.ParserRules,\n+emojiOnlyFactor: ?number,\n// We need to use a Text container for Entry because it needs to match up\n// exactly with TextInput. However, if we use a Text container, we can't\n@@ -42,9 +42,9 @@ const inlineMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n...SimpleMarkdown.defaultRules.link,\nmatch: () => null,\nreact(\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) {\nreturn (\n<MarkdownLink\n@@ -65,7 +65,7 @@ const inlineMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n// We want to keep the newlines, but when rendering within a View, we\n// strip just one trailing newline off, since the View adds vertical\n// spacing between its children\n- match: (source: string, state: SimpleMarkdown.State) => {\n+ match: (source: string, state: SharedMarkdown.State) => {\nif (state.inline) {\nreturn null;\n} else if (state.container === 'View') {\n@@ -75,9 +75,9 @@ const inlineMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n}\n},\nparse(\n- capture: SimpleMarkdown.Capture,\n- parse: SimpleMarkdown.Parser,\n- state: SimpleMarkdown.State,\n+ capture: SharedMarkdown.Capture,\n+ parse: SharedMarkdown.Parser,\n+ state: SharedMarkdown.State,\n) {\nlet content = capture[1];\nif (state.container === 'View') {\n@@ -92,9 +92,9 @@ const inlineMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n},\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<Text key={state.key} style={state.textStyle}>\n{output(node.content, state)}\n@@ -132,9 +132,9 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n...SimpleMarkdown.defaultRules.em,\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<Text key={state.key} style={styles.italics}>\n{output(node.content, state)}\n@@ -145,9 +145,9 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n...SimpleMarkdown.defaultRules.strong,\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<Text key={state.key} style={styles.bold}>\n{output(node.content, state)}\n@@ -158,9 +158,9 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n...SimpleMarkdown.defaultRules.u,\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<Text key={state.key} style={styles.underline}>\n{output(node.content, state)}\n@@ -171,9 +171,9 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n...SimpleMarkdown.defaultRules.del,\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<Text key={state.key} style={styles.strikethrough}>\n{output(node.content, state)}\n@@ -184,9 +184,9 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n...SimpleMarkdown.defaultRules.inlineCode,\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<Text key={state.key} style={styles.inlineCode}>\n{node.content}\n@@ -200,9 +200,9 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n),\n// eslint-disable-next-line react/display-name\nreact(\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) {\nconst headingStyle = styles['h' + node.level];\nreturn (\n@@ -219,9 +219,9 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\nSharedMarkdown.blockQuoteStripFollowingNewlineRegex,\n),\nparse(\n- capture: SimpleMarkdown.Capture,\n- parse: SimpleMarkdown.Parser,\n- state: SimpleMarkdown.State,\n+ capture: SharedMarkdown.Capture,\n+ parse: SharedMarkdown.Parser,\n+ state: SharedMarkdown.State,\n) {\nconst content = capture[1].replace(/^ *> ?/gm, '');\nreturn {\n@@ -230,9 +230,9 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\n},\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<View key={state.key} style={styles.blockQuote}>\n{output(node.content, state)}\n@@ -244,16 +244,16 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\nmatch: SimpleMarkdown.blockRegex(\nSharedMarkdown.codeBlockStripTrailingNewlineRegex,\n),\n- parse(capture: SimpleMarkdown.Capture) {\n+ parse(capture: SharedMarkdown.Capture) {\nreturn {\ncontent: capture[1].replace(/^ {4}/gm, ''),\n};\n},\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<View key={state.key} style={styles.codeBlock}>\n<Text style={[state.textStyle, styles.codeBlockText]}>\n@@ -267,32 +267,35 @@ const fullMarkdownRules: boolean => MarkdownRules = _memoize(useDarkStyle => {\nmatch: SimpleMarkdown.blockRegex(\nSharedMarkdown.fenceStripTrailingNewlineRegex,\n),\n- parse: (capture: SimpleMarkdown.Capture) => ({\n+ parse: (capture: SharedMarkdown.Capture) => ({\ntype: 'codeBlock',\ncontent: capture[2],\n}),\n},\njson: {\norder: SimpleMarkdown.defaultRules.paragraph.order - 1,\n- match: (source: string, state: SimpleMarkdown.State) => {\n+ match: (source: string, state: SharedMarkdown.State) => {\nif (state.inline) {\nreturn null;\n}\nreturn SharedMarkdown.jsonMatch(source);\n},\n- parse: (capture: SimpleMarkdown.Capture) => ({\n+ parse: (capture: SharedMarkdown.Capture) => {\n+ const jsonCapture: SharedMarkdown.JSONCapture = (capture: any);\n+ return {\ntype: 'codeBlock',\n- content: SharedMarkdown.jsonPrint(capture),\n- }),\n+ content: SharedMarkdown.jsonPrint(jsonCapture),\n+ };\n+ },\n},\nlist: {\n...SimpleMarkdown.defaultRules.list,\nmatch: SharedMarkdown.matchList,\nparse: SharedMarkdown.parseList,\nreact(\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) {\nconst children = node.items.map((item, i) => {\nconst content = output(item, state);\n@@ -355,14 +358,14 @@ function textMessageRules(\nmention: {\n...SimpleMarkdown.defaultRules.strong,\nmatch: SharedMarkdown.matchMentions(members),\n- parse: (capture: SimpleMarkdown.Capture) => ({\n+ parse: (capture: SharedMarkdown.Capture) => ({\ncontent: capture[0],\n}),\n// eslint-disable-next-line react/display-name\nreact: (\n- node: SimpleMarkdown.SingleASTNode,\n- output: SimpleMarkdown.Output<SimpleMarkdown.ReactElement>,\n- state: SimpleMarkdown.State,\n+ node: SharedMarkdown.SingleASTNode,\n+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,\n+ state: SharedMarkdown.State,\n) => (\n<Text key={state.key} style={styles.bold}>\n{node.content}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 36/*: Fix native simple-markdown types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1732
129,187
14.07.2021 15:53:45
14,400
543c42cb2f9d24c1ca45195e40e8d51532941d27
RN0.64 37/*: Update Redux libdef Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "lib/flow-typed/npm/redux_v4.x.x.js", "new_path": "lib/flow-typed/npm/redux_v4.x.x.js", "diff": "-// flow-typed signature: 99b2d8ebd0ab4be20976dc62a3bbf54c\n-// flow-typed version: c6154227d1/redux_v4.x.x/flow_>=v0.89.x <=v0.103.x\n+// flow-typed signature: cf5a251230b87bfccb7000d63228c501\n+// flow-typed version: 7735fcd9c6/redux_v4.x.x/flow_>=v0.134.x\ndeclare module 'redux' {\n/*\n@@ -10,17 +10,16 @@ declare module 'redux' {\n*/\n- declare export type Action<T> = {\n- type: T\n- }\n+ declare export type Action<T> = { type: T, ... }\ndeclare export type DispatchAPI<A> = (action: A) => A;\n- declare export type Dispatch<A: { type: * }> = DispatchAPI<A>;\n+ declare export type Dispatch<A: { +type: *, ... }> = DispatchAPI<A>;\ndeclare export type MiddlewareAPI<S, A, D = Dispatch<A>> = {\ndispatch: D,\ngetState(): S,\n+ ...\n};\ndeclare export type Store<S, A, D = Dispatch<A>> = {\n@@ -29,12 +28,13 @@ declare module 'redux' {\ngetState(): S,\nsubscribe(listener: () => void): () => void,\nreplaceReducer(nextReducer: Reducer<S, A>): void,\n+ ...\n};\ndeclare export type Reducer<S, A> = (state: S | void, action: A) => S;\ndeclare export type CombinedReducer<S, A> = (\n- state: ($Shape<S> & {}) | void,\n+ state: ($Shape<S> & {...}) | void,\naction: A\n) => S;\n@@ -49,6 +49,7 @@ declare module 'redux' {\npreloadedState: S,\nenhancer?: StoreEnhancer<S, A, D>\n): Store<S, A, D>,\n+ ...\n};\ndeclare export type StoreEnhancer<S, A, D = Dispatch<A>> = (\n@@ -70,9 +71,7 @@ declare module 'redux' {\n): StoreEnhancer<S, A, D>;\ndeclare export type ActionCreator<A, B> = (...args: Array<B>) => A;\n- declare export type ActionCreators<K, A> = {\n- [key: K]: ActionCreator<A, any>,\n- };\n+ declare export type ActionCreators<K, A> = { [key: K]: ActionCreator<A, any>, ... };\ndeclare export function bindActionCreators<\nA,\n@@ -92,7 +91,7 @@ declare module 'redux' {\ndispatch: D\n): C;\n- declare export function combineReducers<O: {}, A>(\n+ declare export function combineReducers<O: {...}, A>(\nreducers: O\n): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>;\n" }, { "change_type": "MODIFY", "old_path": "native/flow-typed/npm/redux_v4.x.x.js", "new_path": "native/flow-typed/npm/redux_v4.x.x.js", "diff": "-// flow-typed signature: 99b2d8ebd0ab4be20976dc62a3bbf54c\n-// flow-typed version: c6154227d1/redux_v4.x.x/flow_>=v0.89.x <=v0.103.x\n+// flow-typed signature: cf5a251230b87bfccb7000d63228c501\n+// flow-typed version: 7735fcd9c6/redux_v4.x.x/flow_>=v0.134.x\ndeclare module 'redux' {\n/*\n@@ -10,17 +10,16 @@ declare module 'redux' {\n*/\n- declare export type Action<T> = {\n- type: T\n- }\n+ declare export type Action<T> = { type: T, ... }\ndeclare export type DispatchAPI<A> = (action: A) => A;\n- declare export type Dispatch<A: { type: * }> = DispatchAPI<A>;\n+ declare export type Dispatch<A: { +type: *, ... }> = DispatchAPI<A>;\ndeclare export type MiddlewareAPI<S, A, D = Dispatch<A>> = {\ndispatch: D,\ngetState(): S,\n+ ...\n};\ndeclare export type Store<S, A, D = Dispatch<A>> = {\n@@ -29,12 +28,13 @@ declare module 'redux' {\ngetState(): S,\nsubscribe(listener: () => void): () => void,\nreplaceReducer(nextReducer: Reducer<S, A>): void,\n+ ...\n};\ndeclare export type Reducer<S, A> = (state: S | void, action: A) => S;\ndeclare export type CombinedReducer<S, A> = (\n- state: ($Shape<S> & {}) | void,\n+ state: ($Shape<S> & {...}) | void,\naction: A\n) => S;\n@@ -49,6 +49,7 @@ declare module 'redux' {\npreloadedState: S,\nenhancer?: StoreEnhancer<S, A, D>\n): Store<S, A, D>,\n+ ...\n};\ndeclare export type StoreEnhancer<S, A, D = Dispatch<A>> = (\n@@ -70,9 +71,7 @@ declare module 'redux' {\n): StoreEnhancer<S, A, D>;\ndeclare export type ActionCreator<A, B> = (...args: Array<B>) => A;\n- declare export type ActionCreators<K, A> = {\n- [key: K]: ActionCreator<A, any>,\n- };\n+ declare export type ActionCreators<K, A> = { [key: K]: ActionCreator<A, any>, ... };\ndeclare export function bindActionCreators<\nA,\n@@ -92,7 +91,7 @@ declare module 'redux' {\ndispatch: D\n): C;\n- declare export function combineReducers<O: {}, A>(\n+ declare export function combineReducers<O: {...}, A>(\nreducers: O\n): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>;\n" }, { "change_type": "MODIFY", "old_path": "server/flow-typed/npm/redux_v4.x.x.js", "new_path": "server/flow-typed/npm/redux_v4.x.x.js", "diff": "-// flow-typed signature: 99b2d8ebd0ab4be20976dc62a3bbf54c\n-// flow-typed version: c6154227d1/redux_v4.x.x/flow_>=v0.89.x <=v0.103.x\n+// flow-typed signature: cf5a251230b87bfccb7000d63228c501\n+// flow-typed version: 7735fcd9c6/redux_v4.x.x/flow_>=v0.134.x\ndeclare module 'redux' {\n/*\n@@ -10,17 +10,16 @@ declare module 'redux' {\n*/\n- declare export type Action<T> = {\n- type: T\n- }\n+ declare export type Action<T> = { type: T, ... }\ndeclare export type DispatchAPI<A> = (action: A) => A;\n- declare export type Dispatch<A: { type: * }> = DispatchAPI<A>;\n+ declare export type Dispatch<A: { +type: *, ... }> = DispatchAPI<A>;\ndeclare export type MiddlewareAPI<S, A, D = Dispatch<A>> = {\ndispatch: D,\ngetState(): S,\n+ ...\n};\ndeclare export type Store<S, A, D = Dispatch<A>> = {\n@@ -29,12 +28,13 @@ declare module 'redux' {\ngetState(): S,\nsubscribe(listener: () => void): () => void,\nreplaceReducer(nextReducer: Reducer<S, A>): void,\n+ ...\n};\ndeclare export type Reducer<S, A> = (state: S | void, action: A) => S;\ndeclare export type CombinedReducer<S, A> = (\n- state: ($Shape<S> & {}) | void,\n+ state: ($Shape<S> & {...}) | void,\naction: A\n) => S;\n@@ -49,6 +49,7 @@ declare module 'redux' {\npreloadedState: S,\nenhancer?: StoreEnhancer<S, A, D>\n): Store<S, A, D>,\n+ ...\n};\ndeclare export type StoreEnhancer<S, A, D = Dispatch<A>> = (\n@@ -70,9 +71,7 @@ declare module 'redux' {\n): StoreEnhancer<S, A, D>;\ndeclare export type ActionCreator<A, B> = (...args: Array<B>) => A;\n- declare export type ActionCreators<K, A> = {\n- [key: K]: ActionCreator<A, any>,\n- };\n+ declare export type ActionCreators<K, A> = { [key: K]: ActionCreator<A, any>, ... };\ndeclare export function bindActionCreators<\nA,\n@@ -92,7 +91,7 @@ declare module 'redux' {\ndispatch: D\n): C;\n- declare export function combineReducers<O: {}, A>(\n+ declare export function combineReducers<O: {...}, A>(\nreducers: O\n): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>;\n" }, { "change_type": "MODIFY", "old_path": "web/flow-typed/npm/redux_v4.x.x.js", "new_path": "web/flow-typed/npm/redux_v4.x.x.js", "diff": "-// flow-typed signature: 99b2d8ebd0ab4be20976dc62a3bbf54c\n-// flow-typed version: c6154227d1/redux_v4.x.x/flow_>=v0.89.x <=v0.103.x\n+// flow-typed signature: cf5a251230b87bfccb7000d63228c501\n+// flow-typed version: 7735fcd9c6/redux_v4.x.x/flow_>=v0.134.x\ndeclare module 'redux' {\n/*\n@@ -10,17 +10,16 @@ declare module 'redux' {\n*/\n- declare export type Action<T> = {\n- type: T\n- }\n+ declare export type Action<T> = { type: T, ... }\ndeclare export type DispatchAPI<A> = (action: A) => A;\n- declare export type Dispatch<A: { type: * }> = DispatchAPI<A>;\n+ declare export type Dispatch<A: { +type: *, ... }> = DispatchAPI<A>;\ndeclare export type MiddlewareAPI<S, A, D = Dispatch<A>> = {\ndispatch: D,\ngetState(): S,\n+ ...\n};\ndeclare export type Store<S, A, D = Dispatch<A>> = {\n@@ -29,12 +28,13 @@ declare module 'redux' {\ngetState(): S,\nsubscribe(listener: () => void): () => void,\nreplaceReducer(nextReducer: Reducer<S, A>): void,\n+ ...\n};\ndeclare export type Reducer<S, A> = (state: S | void, action: A) => S;\ndeclare export type CombinedReducer<S, A> = (\n- state: ($Shape<S> & {}) | void,\n+ state: ($Shape<S> & {...}) | void,\naction: A\n) => S;\n@@ -49,6 +49,7 @@ declare module 'redux' {\npreloadedState: S,\nenhancer?: StoreEnhancer<S, A, D>\n): Store<S, A, D>,\n+ ...\n};\ndeclare export type StoreEnhancer<S, A, D = Dispatch<A>> = (\n@@ -70,9 +71,7 @@ declare module 'redux' {\n): StoreEnhancer<S, A, D>;\ndeclare export type ActionCreator<A, B> = (...args: Array<B>) => A;\n- declare export type ActionCreators<K, A> = {\n- [key: K]: ActionCreator<A, any>,\n- };\n+ declare export type ActionCreators<K, A> = { [key: K]: ActionCreator<A, any>, ... };\ndeclare export function bindActionCreators<\nA,\n@@ -92,7 +91,7 @@ declare module 'redux' {\ndispatch: D\n): C;\n- declare export function combineReducers<O: {}, A>(\n+ declare export function combineReducers<O: {...}, A>(\nreducers: O\n): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 37/*: Update Redux libdef Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1733
129,187
15.07.2021 17:24:42
14,400
b6b486c7cdca4368391939f241856bb11521a1cb
RN0.64 41/*: Patch react-native-firebase Flow types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "patches/react-native-firebase+5.6.0.patch", "new_path": "patches/react-native-firebase+5.6.0.patch", "diff": "+diff --git a/node_modules/react-native-firebase/dist/common/commonTypes.flow.js.flow b/node_modules/react-native-firebase/dist/common/commonTypes.flow.js.flow\n+index 228a72d..982a997 100644\n+--- a/node_modules/react-native-firebase/dist/common/commonTypes.flow.js.flow\n++++ b/node_modules/react-native-firebase/dist/common/commonTypes.flow.js.flow\n+@@ -1,3 +1,5 @@\n++// @flow\n++\n+ export type NativeErrorObject = {\n+ code: string,\n+ message: string,\n+@@ -11,9 +13,9 @@ export type NativeErrorResponse = {\n+ [key: string]: ?any,\n+ };\n+\n+-export interface NativeErrorInterface extends Error {\n++export interface NativeErrorInterface {\n+ +code: string;\n+- +message: string;\n++ message: string;\n+ +nativeErrorCode: string | number;\n+ +nativeErrorMessage: string;\n+ }\n+diff --git a/node_modules/react-native-firebase/dist/modules/admob/AdRequest.js.flow b/node_modules/react-native-firebase/dist/modules/admob/AdRequest.js.flow\n+index 41d2d5d..c2f5e0a 100644\n+--- a/node_modules/react-native-firebase/dist/modules/admob/AdRequest.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/admob/AdRequest.js.flow\n+@@ -1,4 +1,18 @@\n++// @flow\n++\n++type AdRequestProps = {|\n++ keywords: string[],\n++ testDevices: string[],\n++ contentUrl?: string,\n++ gender?: Gender,\n++ requestAgent?: string,\n++ isDesignedForFamilies?: boolean,\n++ tagForChildDirectedTreatment?: boolean,\n++|};\n++type Gender = 'male | female | unknown';\n+ export default class AdRequest {\n++ _props: AdRequestProps;\n++\n+ constructor() {\n+ this._props = {\n+ keywords: [],\n+@@ -6,30 +20,30 @@ export default class AdRequest {\n+ };\n+ }\n+\n+- build() {\n++ build(): AdRequestProps {\n+ return this._props;\n+ }\n+\n+- addTestDevice(deviceId?: string) {\n++ addTestDevice(deviceId?: string): AdRequest {\n+ this._props.testDevices.push(deviceId || 'DEVICE_ID_EMULATOR');\n+ return this;\n+ }\n+\n+- addKeyword(keyword: string) {\n++ addKeyword(keyword: string): AdRequest {\n+ this._props.keywords.push(keyword);\n+ return this;\n+ }\n+\n+- setBirthday() {\n++ setBirthday(): void {\n+ // TODO\n+ }\n+\n+- setContentUrl(url: string) {\n++ setContentUrl(url: string): AdRequest {\n+ this._props.contentUrl = url;\n+ return this;\n+ }\n+\n+- setGender(gender: 'male | female | unknown') {\n++ setGender(gender: Gender): AdRequest {\n+ const genders = ['male', 'female', 'unknown'];\n+ if (genders.includes(gender)) {\n+ this._props.gender = gender;\n+@@ -37,21 +51,21 @@ export default class AdRequest {\n+ return this;\n+ }\n+\n+- setLocation() {\n++ setLocation(): void {\n+ // TODO\n+ }\n+\n+- setRequestAgent(requestAgent: string) {\n++ setRequestAgent(requestAgent: string): AdRequest {\n+ this._props.requestAgent = requestAgent;\n+ return this;\n+ }\n+\n+- setIsDesignedForFamilies(isDesignedForFamilies: boolean) {\n++ setIsDesignedForFamilies(isDesignedForFamilies: boolean): AdRequest {\n+ this._props.isDesignedForFamilies = isDesignedForFamilies;\n+ return this;\n+ }\n+\n+- tagForChildDirectedTreatment(tagForChildDirectedTreatment: boolean) {\n++ tagForChildDirectedTreatment(tagForChildDirectedTreatment: boolean): AdRequest {\n+ this._props.tagForChildDirectedTreatment = tagForChildDirectedTreatment;\n+ return this;\n+ }\n+diff --git a/node_modules/react-native-firebase/dist/modules/admob/Interstitial.js.flow b/node_modules/react-native-firebase/dist/modules/admob/Interstitial.js.flow\n+index a2f4c82..db795d7 100644\n+--- a/node_modules/react-native-firebase/dist/modules/admob/Interstitial.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/admob/Interstitial.js.flow\n+@@ -1,3 +1,5 @@\n++// @flow\n++\n+ import { Platform } from 'react-native';\n+ import { statics } from './';\n+ import AdRequest from './AdRequest';\n+@@ -8,8 +10,10 @@ import type AdMob from './';\n+\n+ let subscriptions = [];\n+\n+-export default class Interstitial {\n++class Interstitial {\n+ _admob: AdMob;\n++ adUnit: string;\n++ loaded: boolean;\n+\n+ constructor(admob: AdMob, adUnit: string) {\n+ // Interstitials on iOS require a new instance each time\n+@@ -79,7 +83,7 @@ export default class Interstitial {\n+ * Return a local instance of isLoaded\n+ * @returns {boolean}\n+ */\n+- isLoaded() {\n++ isLoaded(): boolean {\n+ return this.loaded;\n+ }\n+\n+@@ -87,7 +91,7 @@ export default class Interstitial {\n+ * Show the advert - will only show if loaded\n+ * @returns {*}\n+ */\n+- show() {\n++ show(): void {\n+ if (this.loaded) {\n+ getNativeModule(this._admob).interstitialShowAd(this.adUnit);\n+ }\n+@@ -99,7 +103,7 @@ export default class Interstitial {\n+ * @param listenerCb\n+ * @returns {null}\n+ */\n+- on(eventType, listenerCb) {\n++ on(eventType: string, listenerCb: Function) {\n+ if (!statics.EventTypes[eventType]) {\n+ console.warn(\n+ `Invalid event type provided, must be one of: ${Object.keys(\n+@@ -117,3 +121,5 @@ export default class Interstitial {\n+ return sub;\n+ }\n+ }\n++\n++export default Interstitial;\n+diff --git a/node_modules/react-native-firebase/dist/modules/admob/RewardedVideo.js.flow b/node_modules/react-native-firebase/dist/modules/admob/RewardedVideo.js.flow\n+index d89df42..ab3bc43 100644\n+--- a/node_modules/react-native-firebase/dist/modules/admob/RewardedVideo.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/admob/RewardedVideo.js.flow\n+@@ -1,3 +1,5 @@\n++// @flow\n++\n+ import { statics } from './';\n+ import AdRequest from './AdRequest';\n+ import { SharedEventEmitter } from '../../utils/events';\n+@@ -9,6 +11,8 @@ let subscriptions = [];\n+\n+ export default class RewardedVideo {\n+ _admob: AdMob;\n++ adUnit: string;\n++ loaded: boolean;\n+\n+ constructor(admob: AdMob, adUnit: string) {\n+ for (let i = 0, len = subscriptions.length; i < len; i++) {\n+@@ -106,7 +110,7 @@ export default class RewardedVideo {\n+ * @param listenerCb\n+ * @returns {null}\n+ */\n+- on(eventType, listenerCb) {\n++ on(eventType: string, listenerCb: Function) {\n+ const types = {\n+ ...statics.EventTypes,\n+ ...statics.RewardedVideoEventTypes,\n+diff --git a/node_modules/react-native-firebase/dist/modules/auth/AuthSettings.js.flow b/node_modules/react-native-firebase/dist/modules/auth/AuthSettings.js.flow\n+index 997efc7..7b84def 100644\n+--- a/node_modules/react-native-firebase/dist/modules/auth/AuthSettings.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/auth/AuthSettings.js.flow\n+@@ -1,3 +1,5 @@\n++// @flow\n++\n+ import { getNativeModule } from '../../utils/native';\n+ import { isAndroid, isIOS } from '../../utils';\n+\n+diff --git a/node_modules/react-native-firebase/dist/modules/auth/User.js.flow b/node_modules/react-native-firebase/dist/modules/auth/User.js.flow\n+index 96026b6..86c9b24 100644\n+--- a/node_modules/react-native-firebase/dist/modules/auth/User.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/auth/User.js.flow\n+@@ -16,10 +16,10 @@ import type {\n+ IdTokenResult,\n+ } from './types';\n+\n+-type UpdateProfile = {\n+- displayName?: string,\n+- photoURL?: string,\n+-};\n++type UpdateProfile = $Shape<{|\n++ +displayName?: string,\n++ +photoURL?: string,\n++|}>;\n+\n+ export default class User {\n+ _auth: Auth;\n+diff --git a/node_modules/react-native-firebase/dist/modules/core/app.js.flow b/node_modules/react-native-firebase/dist/modules/core/app.js.flow\n+index 6e27c61..c9019c3 100644\n+--- a/node_modules/react-native-firebase/dist/modules/core/app.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/core/app.js.flow\n+@@ -77,7 +77,7 @@ export default class App {\n+ fromNative: boolean = false\n+ ) {\n+ this._name = name;\n+- this._options = Object.assign({}, options);\n++ this._options = { ...options };\n+\n+ if (fromNative) {\n+ this._initialized = true;\n+@@ -129,7 +129,7 @@ export default class App {\n+ * @return {*}\n+ */\n+ get options(): FirebaseOptions {\n+- return Object.assign({}, this._options);\n++ return { ...this._options };\n+ }\n+\n+ /**\ndiff --git a/node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js.flow b/node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js.flow\n-index b8ef7c2..7ecb834 100644\n+index b8ef7c2..37fe40e 100644\n--- a/node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js.flow\n+++ b/node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js.flow\n@@ -8,7 +8,7 @@ import CollectionReference from './CollectionReference';\n@@ -40,7 +282,7 @@ index b8ef7c2..7ecb834 100644\n) {\nthrow new Error(\n'DocumentReference.onSnapshot failed: Observer.error must be a valid function.'\n-@@ -181,8 +181,8 @@ export default class DocumentReference {\n+@@ -181,27 +181,27 @@ export default class DocumentReference {\n) {\ndocListenOptions = optionsOrObserverOrOnNext;\n// Called with: Options, onNext, ?onError\n@@ -51,7 +293,13 @@ index b8ef7c2..7ecb834 100644\nthrow new Error(\n'DocumentReference.onSnapshot failed: Third argument must be a valid function.'\n);\n-@@ -195,13 +195,13 @@ export default class DocumentReference {\n+ }\n+- // $FlowExpectedError: Not coping with the overloaded method signature\n+ observer = {\n++ // $FlowExpectedError: Not coping with the overloaded method signature\n+ next: observerOrOnNextOrOnError,\n+ error: onError,\n+ };\n// Called with Options, Observer\n} else if (\nobserverOrOnNextOrOnError &&\n@@ -68,8 +316,21 @@ index b8ef7c2..7ecb834 100644\n) {\nthrow new Error(\n'DocumentReference.onSnapshot failed: Observer.error must be a valid function.'\n+diff --git a/node_modules/react-native-firebase/dist/modules/firestore/FieldValue.js.flow b/node_modules/react-native-firebase/dist/modules/firestore/FieldValue.js.flow\n+index edbd9dc..c4e2598 100644\n+--- a/node_modules/react-native-firebase/dist/modules/firestore/FieldValue.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/firestore/FieldValue.js.flow\n+@@ -2,7 +2,7 @@\n+ * @flow\n+ * FieldValue representation wrapper\n+ */\n+-import AnyJs from './utils/any';\n++import type { AnyJs } from './utils/any';\n+ import { buildNativeArray } from './utils/serialize';\n+\n+ // TODO: Salakar: Refactor in v6\ndiff --git a/node_modules/react-native-firebase/dist/modules/firestore/Query.js.flow b/node_modules/react-native-firebase/dist/modules/firestore/Query.js.flow\n-index 1716dbe..8a52a88 100644\n+index 1716dbe..80df382 100644\n--- a/node_modules/react-native-firebase/dist/modules/firestore/Query.js.flow\n+++ b/node_modules/react-native-firebase/dist/modules/firestore/Query.js.flow\n@@ -8,7 +8,7 @@ import SnapshotError from './SnapshotError';\n@@ -81,6 +342,24 @@ index 1716dbe..8a52a88 100644\nimport { getAppEventName, SharedEventEmitter } from '../../utils/events';\nimport type Firestore from './';\n+@@ -55,7 +55,7 @@ type FieldOrder = {|\n+ fieldPath: NativeFieldPath,\n+ |};\n+\n+-type QueryOptions = {\n++type QueryOptions = $Shape<{|\n+ endAt?: any[],\n+ endBefore?: any[],\n+ limit?: number,\n+@@ -63,7 +63,7 @@ type QueryOptions = {\n+ selectFields?: string[],\n+ startAfter?: any[],\n+ startAt?: any[],\n+-};\n++|}>;\n+\n+ export type ObserverOnError = SnapshotError => void;\n+ export type ObserverOnNext = QuerySnapshot => void;\n@@ -274,8 +274,8 @@ export default class Query {\nlet observer: Observer;\nlet metadataChanges = {};\n@@ -110,7 +389,7 @@ index 1716dbe..8a52a88 100644\n) {\nthrow new Error(\n'Query.onSnapshot failed: Observer.error must be a valid function.'\n-@@ -318,8 +318,8 @@ export default class Query {\n+@@ -318,27 +318,27 @@ export default class Query {\n) {\nmetadataChanges = optionsOrObserverOrOnNext;\n// Called with: Options, onNext, ?onError\n@@ -121,7 +400,13 @@ index 1716dbe..8a52a88 100644\nthrow new Error(\n'Query.onSnapshot failed: Third argument must be a valid function.'\n);\n-@@ -332,13 +332,13 @@ export default class Query {\n+ }\n+- // $FlowExpectedError: Not coping with the overloaded method signature\n+ observer = {\n++ // $FlowExpectedError: Not coping with the overloaded method signature\n+ next: observerOrOnNextOrOnError,\n+ error: onError,\n+ };\n// Called with Options, Observer\n} else if (\nobserverOrOnNextOrOnError &&\n@@ -138,6 +423,32 @@ index 1716dbe..8a52a88 100644\n) {\nthrow new Error(\n'Query.onSnapshot failed: Observer.error must be a valid function.'\n+diff --git a/node_modules/react-native-firebase/dist/modules/firestore/SnapshotError.js.flow b/node_modules/react-native-firebase/dist/modules/firestore/SnapshotError.js.flow\n+index 105574d..c34819e 100644\n+--- a/node_modules/react-native-firebase/dist/modules/firestore/SnapshotError.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/firestore/SnapshotError.js.flow\n+@@ -1,3 +1,5 @@\n++// @flow\n++\n+ import NativeError from '../../common/NativeError';\n+ import type { SnapshotErrorInterface } from './firestoreTypes.flow';\n+ import type { NativeErrorResponse } from '../../common/commonTypes.flow';\n+diff --git a/node_modules/react-native-firebase/dist/modules/firestore/Transaction.js.flow b/node_modules/react-native-firebase/dist/modules/firestore/Transaction.js.flow\n+index 0f96640..b564830 100644\n+--- a/node_modules/react-native-firebase/dist/modules/firestore/Transaction.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/firestore/Transaction.js.flow\n+@@ -18,9 +18,9 @@ type Command = {\n+ options?: SetOptions | {},\n+ };\n+\n+-type SetOptions = {\n++type SetOptions = $Shape<{|\n+ merge: boolean,\n+-};\n++|}>;\n+\n+ // TODO docs state all get requests must be made FIRST before any modifications\n+ // TODO so need to validate that\ndiff --git a/node_modules/react-native-firebase/dist/modules/firestore/TransactionHandler.js.flow b/node_modules/react-native-firebase/dist/modules/firestore/TransactionHandler.js.flow\nindex 624acf0..f4b3039 100644\n--- a/node_modules/react-native-firebase/dist/modules/firestore/TransactionHandler.js.flow\n@@ -151,6 +462,117 @@ index 624acf0..f4b3039 100644\nreject?: Function,\nresolve?: Function,\ntransaction: Transaction,\n+diff --git a/node_modules/react-native-firebase/dist/modules/firestore/utils/any.js.flow b/node_modules/react-native-firebase/dist/modules/firestore/utils/any.js.flow\n+index af9d484..caf587e 100644\n+--- a/node_modules/react-native-firebase/dist/modules/firestore/utils/any.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/firestore/utils/any.js.flow\n+@@ -1,4 +1,7 @@\n++// @flow\n++\n+ /**\n+ * @url https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/util/misc.ts#L26\n+ */\n+-export type AnyJs = null | undefined | boolean | number | string | object;\n++//export type AnyJs = null | void | boolean | number | string | Object;\n++export type AnyJs = any;\n+diff --git a/node_modules/react-native-firebase/dist/modules/firestore/utils/serialize.js.flow b/node_modules/react-native-firebase/dist/modules/firestore/utils/serialize.js.flow\n+index 0c87d1d..fcf97f0 100644\n+--- a/node_modules/react-native-firebase/dist/modules/firestore/utils/serialize.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/firestore/utils/serialize.js.flow\n+@@ -33,7 +33,7 @@ export const buildNativeMap = (data: Object): { [string]: NativeTypeMap } => {\n+ return nativeData;\n+ };\n+\n+-export const buildNativeArray = (array: Object[]): NativeTypeMap[] => {\n++export const buildNativeArray = (array: any[]): NativeTypeMap[] => {\n+ const nativeArray = [];\n+ if (array) {\n+ array.forEach(value => {\n+diff --git a/node_modules/react-native-firebase/dist/modules/functions/HttpsError.js.flow b/node_modules/react-native-firebase/dist/modules/functions/HttpsError.js.flow\n+index e2c7ed3..2c00aa6 100644\n+--- a/node_modules/react-native-firebase/dist/modules/functions/HttpsError.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/functions/HttpsError.js.flow\n+@@ -1,9 +1,11 @@\n++// @flow\n++\n+ import type { FunctionsErrorCode } from './types.flow';\n+\n+ export default class HttpsError extends Error {\n+ +details: ?any;\n+\n+- +message: string;\n++ message: string;\n+\n+ +code: FunctionsErrorCode;\n+\n+@@ -11,6 +13,8 @@ export default class HttpsError extends Error {\n+ super(message);\n+ this.code = code;\n+ this.details = details;\n+- this.message = message;\n++ if (message) {\n++ this.message = message;\n++ }\n+ }\n+ }\n+diff --git a/node_modules/react-native-firebase/dist/modules/functions/types.flow.js.flow b/node_modules/react-native-firebase/dist/modules/functions/types.flow.js.flow\n+index 8660827..0ef93c8 100644\n+--- a/node_modules/react-native-firebase/dist/modules/functions/types.flow.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/functions/types.flow.js.flow\n+@@ -1,3 +1,7 @@\n++// @flow\n++\n++import HttpsError from './HttpsError';\n++\n+ export type HttpsCallableResult = {\n+ data: Object,\n+ };\n+diff --git a/node_modules/react-native-firebase/dist/modules/messaging/IOSMessaging.js.flow b/node_modules/react-native-firebase/dist/modules/messaging/IOSMessaging.js.flow\n+index a97bf75..305b5bc 100644\n+--- a/node_modules/react-native-firebase/dist/modules/messaging/IOSMessaging.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/messaging/IOSMessaging.js.flow\n+@@ -1,3 +1,5 @@\n++// @flow\n++\n+ import { getNativeModule } from '../../utils/native';\n+\n+ import { isIOS } from '../../utils';\n+@@ -5,18 +7,20 @@ import { isIOS } from '../../utils';\n+ import type Messaging from './';\n+\n+ export default class IOSMessaging {\n++ _messaging: Messaging;\n++\n+ constructor(messaging: Messaging) {\n+ this._messaging = messaging;\n+ }\n+\n+- getAPNSToken(): Promise<string | null> {\n++ getAPNSToken(): null | Promise<string | null> {\n+ if (!isIOS) {\n+ return null;\n+ }\n+ return getNativeModule(this._messaging).getAPNSToken();\n+ }\n+\n+- registerForRemoteNotifications(): Promise<void> {\n++ registerForRemoteNotifications(): void | Promise<void> {\n+ if (!isIOS) {\n+ return undefined;\n+ }\n+diff --git a/node_modules/react-native-firebase/dist/modules/messaging/RemoteMessage.js.flow b/node_modules/react-native-firebase/dist/modules/messaging/RemoteMessage.js.flow\n+index d076e23..3388775 100644\n+--- a/node_modules/react-native-firebase/dist/modules/messaging/RemoteMessage.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/messaging/RemoteMessage.js.flow\n+@@ -89,7 +89,7 @@ export default class RemoteMessage {\n+ * @param data\n+ * @returns {RemoteMessage}\n+ */\n+- setData(data: { [string]: string } = {}) {\n++ setData(data: { [string]: string } = {}): RemoteMessage {\n+ if (!isObject(data)) {\n+ throw new Error(\n+ `RemoteMessage:setData expects an object but got type '${typeof data}'.`\ndiff --git a/node_modules/react-native-firebase/dist/modules/messaging/index.js.flow b/node_modules/react-native-firebase/dist/modules/messaging/index.js.flow\nindex 988be94..a030db8 100644\n--- a/node_modules/react-native-firebase/dist/modules/messaging/index.js.flow\n@@ -189,6 +611,16 @@ index 988be94..a030db8 100644\nlistener = nextOrObserver.next;\n} else {\nthrow new Error(\n+diff --git a/node_modules/react-native-firebase/dist/modules/notifications/IOSNotifications.js.flow b/node_modules/react-native-firebase/dist/modules/notifications/IOSNotifications.js.flow\n+index f2ea8ca..5058f52 100644\n+--- a/node_modules/react-native-firebase/dist/modules/notifications/IOSNotifications.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/notifications/IOSNotifications.js.flow\n+@@ -1,3 +1,5 @@\n++// @flow\n++\n+ import { getNativeModule } from '../../utils/native';\n+\n+ import type Notifications from './';\ndiff --git a/node_modules/react-native-firebase/dist/modules/notifications/index.js.flow b/node_modules/react-native-firebase/dist/modules/notifications/index.js.flow\nindex 34e4ee3..22d5dbe 100644\n--- a/node_modules/react-native-firebase/dist/modules/notifications/index.js.flow\n@@ -237,3 +669,38 @@ index 34e4ee3..22d5dbe 100644\nlistener = nextOrObserver.next;\n} else {\nthrow new Error(\n+diff --git a/node_modules/react-native-firebase/dist/modules/utils/database.js.flow b/node_modules/react-native-firebase/dist/modules/utils/database.js.flow\n+index 12fda54..d25b305 100644\n+--- a/node_modules/react-native-firebase/dist/modules/utils/database.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/utils/database.js.flow\n+@@ -1,3 +1,5 @@\n++// @flow\n++\n+ import SyncTree from '../../utils/SyncTree';\n+\n+ export default {\n+diff --git a/node_modules/react-native-firebase/dist/modules/utils/index.js.flow b/node_modules/react-native-firebase/dist/modules/utils/index.js.flow\n+index 463de92..84f24cf 100644\n+--- a/node_modules/react-native-firebase/dist/modules/utils/index.js.flow\n++++ b/node_modules/react-native-firebase/dist/modules/utils/index.js.flow\n+@@ -29,7 +29,7 @@ export default class RNFirebaseUtils extends ModuleBase {\n+ });\n+ }\n+\n+- get database(): DatabaseUtils {\n++ get database(): typeof DatabaseUtils {\n+ return DatabaseUtils;\n+ }\n+\n+diff --git a/node_modules/react-native-firebase/dist/utils/SyncTree.js.flow b/node_modules/react-native-firebase/dist/utils/SyncTree.js.flow\n+index 58d0300..ca6edba 100644\n+--- a/node_modules/react-native-firebase/dist/utils/SyncTree.js.flow\n++++ b/node_modules/react-native-firebase/dist/utils/SyncTree.js.flow\n+@@ -19,6 +19,7 @@ type Registration = {\n+ listener: Listener,\n+ eventRegistrationKey: string,\n+ ref: DatabaseReference,\n++ ...\n+ };\n+\n+ /**\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.64 41/*: Patch react-native-firebase Flow types Test Plan: I tested the whole upgrade together: 1. Compile and run iOS and Android on release and debug 2. Make sure Flow typechecks 3. Make sure debugging tools still work Reviewers: palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1737
129,187
16.07.2021 14:37:17
14,400
5c828a6023207a9092056a360d39585bc4c1a57e
[native] Fix unstable checksum for FBReactNativeSpec Summary: This fixes [this GitHub issue](https://github.com/facebook/react-native/issues/31193) by pulling in [the commit](https://github.com/facebook/react-native/commit/bdfe2a51791046c4e6836576e08655431373ed67) that resolved it. Test Plan: `pod install` Reviewers: atul Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -765,7 +765,7 @@ SPEC CHECKSUMS:\nEXPermissions: 24b97f734ce9172d245a5be38ad9ccfcb6135964\nEXSplashScreen: c4ed5d39cd5dbc1329f8dec720e280276bafa28b\nFBLazyVector: 49cbe4b43e445b06bf29199b6ad2057649e4c8f5\n- FBReactNativeSpec: a54741e1187040b47edc7a0cf6c0cca80ceab705\n+ FBReactNativeSpec: e70e2235774c20416564d24d53d9a69a7abbcbb2\nFlipper: 1bd2db48dcc31e4b167b9a33ec1df01c2ded4893\nFlipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41\nFlipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c\n" }, { "change_type": "MODIFY", "old_path": "patches/react-native+0.64.0.patch", "new_path": "patches/react-native+0.64.0.patch", "diff": "@@ -441,6 +441,146 @@ index 152c1f6..e6c44a9 100644\nboost_compiler_flags = '-Wno-documentation'\nPod::Spec.new do |s|\n+diff --git a/node_modules/react-native/scripts/generate-specs.sh b/node_modules/react-native/scripts/generate-specs.sh\n+index aed955e..b7096de 100755\n+--- a/node_modules/react-native/scripts/generate-specs.sh\n++++ b/node_modules/react-native/scripts/generate-specs.sh\n+@@ -10,14 +10,14 @@\n+ #\n+ # Optionally, set these envvars to override defaults:\n+ # - SRCS_DIR: Path to JavaScript sources\n+-# - CODEGEN_MODULES_LIBRARY_NAME: Defaults to FBReactNativeSpec\n+-# - CODEGEN_MODULES_OUTPUT_DIR: Defaults to React/$CODEGEN_MODULES_LIBRARY_NAME/$CODEGEN_MODULES_LIBRARY_NAME\n+-# - CODEGEN_COMPONENTS_LIBRARY_NAME: Defaults to rncore\n+-# - CODEGEN_COMPONENTS_OUTPUT_DIR: Defaults to ReactCommon/react/renderer/components/$CODEGEN_COMPONENTS_LIBRARY_NAME\n++# - MODULES_LIBRARY_NAME: Defaults to FBReactNativeSpec\n++# - MODULES_OUTPUT_DIR: Defaults to React/$MODULES_LIBRARY_NAME/$MODULES_LIBRARY_NAME\n++# - COMPONENTS_LIBRARY_NAME: Defaults to rncore\n++# - COMPONENTS_OUTPUT_DIR: Defaults to ReactCommon/react/renderer/components/$COMPONENTS_LIBRARY_NAME\n+ #\n+ # Usage:\n+ # ./scripts/generate-specs.sh\n+-# SRCS_DIR=myapp/js CODEGEN_MODULES_LIBRARY_NAME=MySpecs CODEGEN_MODULES_OUTPUT_DIR=myapp/MySpecs ./scripts/generate-specs.sh\n++# SRCS_DIR=myapp/js MODULES_LIBRARY_NAME=MySpecs MODULES_OUTPUT_DIR=myapp/MySpecs ./scripts/generate-specs.sh\n+ #\n+\n+ # shellcheck disable=SC2038\n+@@ -46,13 +46,13 @@ describe () {\n+\n+ main() {\n+ SRCS_DIR=${SRCS_DIR:-$(cd \"$RN_DIR/Libraries\" && pwd)}\n+- CODEGEN_MODULES_LIBRARY_NAME=${CODEGEN_MODULES_LIBRARY_NAME:-FBReactNativeSpec}\n++ MODULES_LIBRARY_NAME=${MODULES_LIBRARY_NAME:-FBReactNativeSpec}\n+\n+- CODEGEN_COMPONENTS_LIBRARY_NAME=${CODEGEN_COMPONENTS_LIBRARY_NAME:-rncore}\n+- CODEGEN_MODULES_OUTPUT_DIR=${CODEGEN_MODULES_OUTPUT_DIR:-\"$RN_DIR/React/$CODEGEN_MODULES_LIBRARY_NAME/$CODEGEN_MODULES_LIBRARY_NAME\"}\n+- # TODO: $CODEGEN_COMPONENTS_PATH should be programmatically specified, and may change with use_frameworks! support.\n+- CODEGEN_COMPONENTS_PATH=\"ReactCommon/react/renderer/components\"\n+- CODEGEN_COMPONENTS_OUTPUT_DIR=${CODEGEN_COMPONENTS_OUTPUT_DIR:-\"$RN_DIR/$CODEGEN_COMPONENTS_PATH/$CODEGEN_COMPONENTS_LIBRARY_NAME\"}\n++ COMPONENTS_LIBRARY_NAME=${COMPONENTS_LIBRARY_NAME:-rncore}\n++ MODULES_OUTPUT_DIR=${MODULES_OUTPUT_DIR:-\"$RN_DIR/React/$MODULES_LIBRARY_NAME/$MODULES_LIBRARY_NAME\"}\n++ # TODO: $COMPONENTS_PATH should be programmatically specified, and may change with use_frameworks! support.\n++ COMPONENTS_PATH=\"ReactCommon/react/renderer/components\"\n++ COMPONENTS_OUTPUT_DIR=${COMPONENTS_OUTPUT_DIR:-\"$RN_DIR/$COMPONENTS_PATH/$COMPONENTS_LIBRARY_NAME\"}\n+\n+ TEMP_OUTPUT_DIR=\"$TEMP_DIR/out\"\n+ SCHEMA_FILE=\"$TEMP_DIR/schema.json\"\n+@@ -75,14 +75,14 @@ main() {\n+\n+ describe \"Generating native code from schema (iOS)\"\n+ pushd \"$RN_DIR\" >/dev/null || exit 1\n+- \"$NODE_BINARY\" scripts/generate-specs-cli.js ios \"$SCHEMA_FILE\" \"$TEMP_OUTPUT_DIR\" \"$CODEGEN_MODULES_LIBRARY_NAME\"\n++ \"$NODE_BINARY\" scripts/generate-specs-cli.js ios \"$SCHEMA_FILE\" \"$TEMP_OUTPUT_DIR\" \"$MODULES_LIBRARY_NAME\"\n+ popd >/dev/null || exit 1\n+\n+ describe \"Copying output to final directory\"\n+- mkdir -p \"$CODEGEN_COMPONENTS_OUTPUT_DIR\" \"$CODEGEN_MODULES_OUTPUT_DIR\"\n+- cp -R \"$TEMP_OUTPUT_DIR/$CODEGEN_MODULES_LIBRARY_NAME.h\" \"$TEMP_OUTPUT_DIR/$CODEGEN_MODULES_LIBRARY_NAME-generated.mm\" \"$CODEGEN_MODULES_OUTPUT_DIR\" || exit 1\n+- find \"$TEMP_OUTPUT_DIR\" -type f | xargs sed -i.bak \"s/$CODEGEN_MODULES_LIBRARY_NAME/$CODEGEN_COMPONENTS_LIBRARY_NAME/g\" || exit 1\n+- find \"$TEMP_OUTPUT_DIR\" -type f -not -iname \"$CODEGEN_MODULES_LIBRARY_NAME*\" -exec cp '{}' \"$CODEGEN_COMPONENTS_OUTPUT_DIR/\" ';' || exit 1\n++ mkdir -p \"$COMPONENTS_OUTPUT_DIR\" \"$MODULES_OUTPUT_DIR\"\n++ cp -R \"$TEMP_OUTPUT_DIR/$MODULES_LIBRARY_NAME.h\" \"$TEMP_OUTPUT_DIR/$MODULES_LIBRARY_NAME-generated.mm\" \"$MODULES_OUTPUT_DIR\" || exit 1\n++ find \"$TEMP_OUTPUT_DIR\" -type f | xargs sed -i.bak \"s/$MODULES_LIBRARY_NAME/$COMPONENTS_LIBRARY_NAME/g\" || exit 1\n++ find \"$TEMP_OUTPUT_DIR\" -type f -not -iname \"$MODULES_LIBRARY_NAME*\" -exec cp '{}' \"$COMPONENTS_OUTPUT_DIR/\" ';' || exit 1\n+\n+ echo >&2 'Done.'\n+ }\n+diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb\n+index 2a8affb..5434997 100644\n+--- a/node_modules/react-native/scripts/react_native_pods.rb\n++++ b/node_modules/react-native/scripts/react_native_pods.rb\n+@@ -148,33 +148,31 @@ end\n+ def use_react_native_codegen!(spec, options={})\n+ return if ENV['DISABLE_CODEGEN'] == '1'\n+\n+- # The path to react-native (e.g. react_native_path)\n+- prefix = options[:path] ||= File.join(__dir__, \"..\")\n++ # The path to react-native\n++ prefix = options[:path] ||= \"${PODS_TARGET_SRCROOT}/../..\"\n+\n+ # The path to JavaScript files\n+- srcs_dir = options[:srcs_dir] ||= File.join(prefix, \"Libraries\")\n++ js_srcs = options[:js_srcs_dir] ||= \"#{prefix}/Libraries\"\n+\n+ # Library name (e.g. FBReactNativeSpec)\n+- codegen_modules_library_name = spec.name\n+- codegen_modules_output_dir = options[:codegen_modules_output_dir] ||= File.join(prefix, \"React/#{codegen_modules_library_name}/#{codegen_modules_library_name}\")\n++ modules_library_name = spec.name\n++ modules_output_dir = \"React/#{modules_library_name}/#{modules_library_name}\"\n+\n+ # Run the codegen as part of the Xcode build pipeline.\n+- env_vars = \"SRCS_DIR=#{srcs_dir}\"\n+- env_vars += \" CODEGEN_MODULES_OUTPUT_DIR=#{codegen_modules_output_dir}\"\n++ env_vars = \"SRCS_DIR=#{js_srcs}\"\n++ env_vars += \" MODULES_OUTPUT_DIR=#{prefix}/#{modules_output_dir}\"\n++ env_vars += \" MODULES_LIBRARY_NAME=#{modules_library_name}\"\n+\n+- # Since the generated files are not guaranteed to exist when CocoaPods is run, we need to create\n+- # empty files to ensure the references are included in the resulting Pods Xcode project.\n+- mkdir_command = \"mkdir -p #{codegen_modules_output_dir}\"\n+- generated_filenames = [ \"#{codegen_modules_library_name}.h\", \"#{codegen_modules_library_name}-generated.mm\" ]\n+- generated_files = generated_filenames.map { |filename| File.join(codegen_modules_output_dir, filename) }\n++ generated_dirs = [ modules_output_dir ]\n++ generated_filenames = [ \"#{modules_library_name}.h\", \"#{modules_library_name}-generated.mm\" ]\n++ generated_files = generated_filenames.map { |filename| \"#{modules_output_dir}/#{filename}\" }\n+\n+ if ENV['USE_FABRIC'] == '1'\n+ # We use a different library name for components, as well as an additional set of files.\n+- # Eventually, we want these to be part of the same library as #{codegen_modules_library_name} above.\n+- codegen_components_library_name = \"rncore\"\n+- codegen_components_output_dir = File.join(prefix, \"ReactCommon/react/renderer/components/#{codegen_components_library_name}\")\n+- env_vars += \" CODEGEN_COMPONENTS_OUTPUT_DIR=#{codegen_components_output_dir}\"\n+- mkdir_command += \" #{codegen_components_output_dir}\"\n++ # Eventually, we want these to be part of the same library as #{modules_library_name} above.\n++ components_output_dir = \"ReactCommon/react/renderer/components/rncore/\"\n++ generated_dirs.push components_output_dir\n++ env_vars += \" COMPONENTS_OUTPUT_DIR=#{prefix}/#{components_output_dir}\"\n+ components_generated_filenames = [\n+ \"ComponentDescriptors.h\",\n+ \"EventEmitters.cpp\",\n+@@ -185,17 +183,16 @@ def use_react_native_codegen!(spec, options={})\n+ \"ShadowNodes.cpp\",\n+ \"ShadowNodes.h\"\n+ ]\n+- generated_files = generated_files.concat(components_generated_filenames.map { |filename| File.join(codegen_components_output_dir, filename) })\n++ generated_files = generated_files.concat(components_generated_filenames.map { |filename| \"#{components_output_dir}/#{filename}\" })\n+ end\n+\n+ spec.script_phase = {\n+ :name => 'Generate Specs',\n+- :input_files => [srcs_dir],\n+- :output_files => [\"$(DERIVED_FILE_DIR)/codegen-#{codegen_modules_library_name}.log\"].concat(generated_files),\n+- :script => \"set -o pipefail\\n\\nbash -l -c '#{env_vars} CODEGEN_MODULES_LIBRARY_NAME=#{codegen_modules_library_name} #{File.join(__dir__, \"generate-specs.sh\")}' 2>&1 | tee \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\",\n++ :input_files => [js_srcs],\n++ :output_files => [\"${DERIVED_FILE_DIR}/codegen-#{modules_library_name}.log\"].concat(generated_files.map { |filename| \"#{prefix}/#{filename}\"} ),\n++ :script => \"set -o pipefail\\n\\nbash -l -c '#{env_vars} ${PODS_TARGET_SRCROOT}/../../scripts/generate-specs.sh' 2>&1 | tee \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\",\n+ :execution_position => :before_compile,\n+ :show_env_vars_in_log => true\n+ }\n+-\n+- spec.prepare_command = \"#{mkdir_command} && touch #{generated_files.reduce() { |str, file| str + \" \" + file }}\"\n++ spec.prepare_command = \"mkdir -p #{generated_dirs.reduce(\"\") { |str, dir| \"#{str} ../../#{dir}\" }} && touch #{generated_files.reduce(\"\") { |str, filename| \"#{str} ../../#{filename}\" }}\"\n+ end\ndiff --git a/node_modules/react-native/third-party-podspecs/RCT-Folly.podspec b/node_modules/react-native/third-party-podspecs/RCT-Folly.podspec\nindex cacafb8..be6da22 100644\n--- a/node_modules/react-native/third-party-podspecs/RCT-Folly.podspec\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix unstable checksum for FBReactNativeSpec Summary: This fixes [this GitHub issue](https://github.com/facebook/react-native/issues/31193) by pulling in [the commit](https://github.com/facebook/react-native/commit/bdfe2a51791046c4e6836576e08655431373ed67) that resolved it. Test Plan: `pod install` Reviewers: atul Reviewed By: atul Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1739
129,187
16.07.2021 23:35:55
14,400
f817a59721bd6cf18fc0d9c405883609456a25fc
[native] Deprecate androidKeyboardResizesFrame Summary: React Native 0.64 no longer supports Android 4. The new `minSdkVersion` is 21, so `androidKeyboardResizesFrame` should always be `false`. This diff removes all the code associated with `androidKeyboardResizesFrame`. Test Plan: Flow Reviewers: atul, palys-swm Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/components/keyboard-avoiding-view.react.js", "new_path": "native/components/keyboard-avoiding-view.react.js", "diff": "@@ -11,7 +11,6 @@ import {\n} from 'react-native';\nimport type { ScreenRect, KeyboardEvent } from '../keyboard/keyboard';\n-import { androidKeyboardResizesFrame } from '../keyboard/keyboard';\nimport {\ntype KeyboardState,\nKeyboardContext,\n@@ -32,23 +31,9 @@ type BaseProps = {\nconst KeyboardAvoidingView: React.ComponentType<BaseProps> = React.memo<BaseProps>(\nfunction KeyboardAvoidingView(props: BaseProps) {\nconst keyboardState = React.useContext(KeyboardContext);\n- if (!androidKeyboardResizesFrame) {\nreturn (\n<InnerKeyboardAvoidingView {...props} keyboardState={keyboardState} />\n);\n- }\n-\n- const { behavior, contentContainerStyle, ...viewProps } = props;\n- if (behavior !== 'position') {\n- return <View {...viewProps} />;\n- }\n-\n- const { children, ...restViewProps } = viewProps;\n- return (\n- <View {...restViewProps}>\n- <View style={contentContainerStyle}>{children}</View>\n- </View>\n- );\n},\n);\n@@ -119,7 +104,6 @@ class InnerKeyboardAvoidingView extends React.PureComponent<Props, State> {\nconst mediaGalleryOpen = keyboardState && keyboardState.mediaGalleryOpen;\nif (\nPlatform.OS === 'android' &&\n- !androidKeyboardResizesFrame &&\nmediaGalleryOpen &&\nthis.keyboardFrame.height > 0 &&\nthis.viewFrame\n" }, { "change_type": "MODIFY", "old_path": "native/keyboard/keyboard-state-container.react.js", "new_path": "native/keyboard/keyboard-state-container.react.js", "diff": "@@ -4,7 +4,6 @@ import * as React from 'react';\nimport { Platform } from 'react-native';\nimport { KeyboardUtils } from 'react-native-keyboard-input';\n-import type { Shape } from 'lib/types/core';\nimport type { ThreadInfo } from 'lib/types/thread-types';\nimport sleep from 'lib/utils/sleep';\n@@ -14,7 +13,6 @@ import {\naddKeyboardShowListener,\naddKeyboardDismissListener,\nremoveKeyboardListener,\n- androidKeyboardResizesFrame,\n} from './keyboard';\nimport KeyboardInputHost from './keyboard-input-host.react';\nimport { KeyboardContext } from './keyboard-state';\n@@ -65,7 +63,7 @@ class KeyboardStateContainer extends React.PureComponent<Props, State> {\n}\ncomponentDidUpdate(prevProps: Props, prevState: State) {\n- if (Platform.OS !== 'android' || androidKeyboardResizesFrame) {\n+ if (Platform.OS !== 'android') {\nreturn;\n}\nif (this.state.mediaGalleryOpen && !prevState.mediaGalleryOpen) {\n@@ -96,14 +94,10 @@ class KeyboardStateContainer extends React.PureComponent<Props, State> {\n}\nshowMediaGallery: (thread: ThreadInfo) => void = (thread: ThreadInfo) => {\n- let updates: Shape<State> = {\n+ this.setState({\nmediaGalleryOpen: true,\nmediaGalleryThread: thread,\n- };\n- if (androidKeyboardResizesFrame) {\n- updates = { ...updates, renderKeyboardInputHost: true };\n- }\n- this.setState(updates);\n+ });\n};\nhideMediaGallery: () => void = () => {\n" }, { "change_type": "MODIFY", "old_path": "native/keyboard/keyboard.js", "new_path": "native/keyboard/keyboard.js", "diff": "@@ -91,8 +91,6 @@ function removeKeyboardListener(listener: EmitterSubscription) {\n// This happens because we set windowTranslucentStatus and\n// windowTranslucentNavigation\n-const androidKeyboardResizesFrame: boolean =\n- Platform.OS === 'android' && Platform.Version < 21;\nconst rnsacThinksAndroidKeyboardResizesFrame: boolean =\nPlatform.OS === 'android' && Platform.Version < 23;\n@@ -102,6 +100,5 @@ export {\naddKeyboardDismissListener,\naddKeyboardDidDismissListener,\nremoveKeyboardListener,\n- androidKeyboardResizesFrame,\nrnsacThinksAndroidKeyboardResizesFrame,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/tab-bar.react.js", "new_path": "native/navigation/tab-bar.react.js", "diff": "@@ -7,7 +7,6 @@ import Animated, { Easing } from 'react-native-reanimated';\nimport { useSafeArea } from 'react-native-safe-area-context';\nimport { useDispatch } from 'react-redux';\n-import { androidKeyboardResizesFrame } from '../keyboard/keyboard';\nimport { KeyboardContext } from '../keyboard/keyboard-state';\nimport { updateDimensionsActiveType } from '../redux/action-types';\nimport { useSelector } from '../redux/redux-utils';\n@@ -28,10 +27,7 @@ function TabBar(props: Props) {\nconst tabBarVisible = tabBarVisibleRef.current;\nconst keyboardState = React.useContext(KeyboardContext);\n- const shouldHideTabBar =\n- keyboardState &&\n- (keyboardState.mediaGalleryOpen ||\n- (keyboardState.keyboardShowing && androidKeyboardResizesFrame));\n+ const shouldHideTabBar = keyboardState?.mediaGalleryOpen;\nconst prevKeyboardStateRef = React.useRef();\nReact.useEffect(() => {\n" }, { "change_type": "MODIFY", "old_path": "native/redux/dimensions-updater.react.js", "new_path": "native/redux/dimensions-updater.react.js", "diff": "@@ -14,7 +14,6 @@ import {\naddKeyboardShowListener,\naddKeyboardDismissListener,\nremoveKeyboardListener,\n- androidKeyboardResizesFrame,\nrnsacThinksAndroidKeyboardResizesFrame,\n} from '../keyboard/keyboard';\nimport { updateDimensionsActiveType } from './action-types';\n@@ -43,8 +42,8 @@ function dimensionsUpdateFromMetrics(metrics: ?Metrics): BaseDimensionsInfo {\nreturn {\nheight: metrics.frame.height,\nwidth: metrics.frame.width,\n- topInset: androidKeyboardResizesFrame ? 0 : metrics.insets.top,\n- bottomInset: androidKeyboardResizesFrame ? 0 : metrics.insets.bottom,\n+ topInset: metrics.insets.top,\n+ bottomInset: metrics.insets.bottom,\n};\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Deprecate androidKeyboardResizesFrame Summary: React Native 0.64 no longer supports Android 4. The new `minSdkVersion` is 21, so `androidKeyboardResizesFrame` should always be `false`. This diff removes all the code associated with `androidKeyboardResizesFrame`. Test Plan: Flow Reviewers: atul, palys-swm Reviewed By: atul Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1748
129,187
16.07.2021 23:33:02
14,400
a9ce31751baad21d824f8d584a9cb1c09e438416
[native] Get rid of assorted JS Android 4 hacks Summary: React Native 0.64 no longer supports Android 4. The new `minSdkVersion` is 21, so we can get rid of these hacks we had in place. Test Plan: Flow Reviewers: atul, palys-swm Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "import invariant from 'invariant';\nimport * as React from 'react';\n-import { StyleSheet, View, Platform } from 'react-native';\n+import { StyleSheet, View } from 'react-native';\nimport Icon from 'react-native-vector-icons/Feather';\nimport { createMessageReply } from 'lib/shared/message-utils';\n@@ -92,7 +92,7 @@ class ComposedMessage extends React.PureComponent<Props> {\nconst fullMessageBoxStyle = [styles.messageBox, messageBoxStyle];\nlet messageBox;\n- if (canSwipe && (Platform.OS !== 'android' || Platform.Version >= 21)) {\n+ if (canSwipe) {\nmessageBox = (\n<SwipeableMessage\nonSwipeableWillOpen={this.reply}\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-navigator.react.js", "new_path": "native/navigation/root-navigator.react.js", "diff": "@@ -40,15 +40,7 @@ import {\ntype RootParamList,\n} from './route-names';\n-if (Platform.OS !== 'android' || Platform.Version >= 21) {\n- // Older Android devices get stack overflows when trying to draw deeply nested\n- // view structures. We've tried to get our draw depth down as much as possible\n- // without going into React Navigation internals or creating a separate render\n- // path for these old Android devices. Because react-native-screens increases\n- // the draw depth enough to cause crashes in some scenarios, we disable it\n- // here for those devices\nenableScreens();\n-}\ntype RootNavigatorProps = StackNavigatorProps<RootRouterNavigationProp<>>;\nfunction RootNavigator({\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of assorted JS Android 4 hacks Summary: React Native 0.64 no longer supports Android 4. The new `minSdkVersion` is 21, so we can get rid of these hacks we had in place. Test Plan: Flow Reviewers: atul, palys-swm Reviewed By: atul Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1749
129,187
17.07.2021 16:33:50
14,400
e40f2154b2ebbab5b5c1e3dc27c6099df739a226
[native] Patch React Native to prepare for Hermes and Flipper 0.98 Summary: These patches are necessary for both to work together. Test Plan: Tested in combination with following diffs Reviewers: atul, palys-swm, karol-bisztyga Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -118,13 +118,13 @@ PODS:\n- RCT-Folly (2021.04.26.00):\n- boost-for-react-native\n- DoubleConversion\n- - fmt\n+ - fmt (~> 6.2.1)\n- glog\n- RCT-Folly/Default (= 2021.04.26.00)\n- RCT-Folly/Default (2021.04.26.00):\n- boost-for-react-native\n- DoubleConversion\n- - fmt\n+ - fmt (~> 6.2.1)\n- glog\n- RCTRequired (0.64.0)\n- RCTTypeSafety (0.64.0):\n@@ -782,12 +782,12 @@ SPEC CHECKSUMS:\nmobile-ffmpeg-min: d5d22dcef5c8ec56f771258f1f5be245d914f193\nOLMKit: a15f216aa14ba199b4fd827b3d7ef04629b56636\nOpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b\n- RCT-Folly: 736f5e696dbcabf6105a547fc2cd7a7001715a32\n+ RCT-Folly: a9c51bfbf65605ded97cf280089c71ce1e886fea\nRCTRequired: 2f8cb5b7533219bf4218a045f92768129cf7050a\nRCTTypeSafety: 05e03dbd833af710de3bd73bcaa12d82c076f855\nReact: 98eac01574128a790f0bbbafe2d1a8607291ac24\nReact-callinvoker: def3f7fae16192df68d9b69fd4bbb59092ee36bc\n- React-Core: eb1582f7f2db218153a41deb682e3d47bc1ae1cc\n+ React-Core: 2af3bc1f2c416007d92dc452a58538c4e647162a\nReact-CoreModules: d4bd38b4926304e8e53ecda6295d1cb24a53ef90\nReact-cxxreact: 5eb9754b2b62a0012d8b3b92139c3c6cbe338f4e\nReact-jsi: 633610cb5c9df5c59ad1577ee61bae9c15d84f30\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Patch React Native to prepare for Hermes and Flipper 0.98 Summary: These patches are necessary for both to work together. Test Plan: Tested in combination with following diffs Reviewers: atul, palys-swm, karol-bisztyga Reviewed By: atul Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1751
129,187
17.07.2021 01:37:07
14,400
b6e788adc7463a2176f77b0cdd316c0ee8668e32
[native] Update to Test Plan: Tested in combination with following diffs Reviewers: atul, palys-swm, karol-bisztyga Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -27,14 +27,14 @@ PODS:\n- UMPermissionsInterface\n- EXSplashScreen (0.3.1):\n- UMCore\n- - FBLazyVector (0.64.0)\n- - FBReactNativeSpec (0.64.0):\n+ - FBLazyVector (0.64.2)\n+ - FBReactNativeSpec (0.64.2):\n- RCT-Folly (= 2021.04.26.00)\n- - RCTRequired (= 0.64.0)\n- - RCTTypeSafety (= 0.64.0)\n- - React-Core (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n+ - RCTRequired (= 0.64.2)\n+ - RCTTypeSafety (= 0.64.2)\n+ - React-Core (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n- Flipper (0.87.0):\n- Flipper-Folly (~> 2.5)\n- Flipper-RSocket (~> 1.3)\n@@ -126,190 +126,190 @@ PODS:\n- DoubleConversion\n- fmt (~> 6.2.1)\n- glog\n- - RCTRequired (0.64.0)\n- - RCTTypeSafety (0.64.0):\n- - FBLazyVector (= 0.64.0)\n+ - RCTRequired (0.64.2)\n+ - RCTTypeSafety (0.64.2):\n+ - FBLazyVector (= 0.64.2)\n- RCT-Folly (= 2021.04.26.00)\n- - RCTRequired (= 0.64.0)\n- - React-Core (= 0.64.0)\n- - React (0.64.0):\n- - React-Core (= 0.64.0)\n- - React-Core/DevSupport (= 0.64.0)\n- - React-Core/RCTWebSocket (= 0.64.0)\n- - React-RCTActionSheet (= 0.64.0)\n- - React-RCTAnimation (= 0.64.0)\n- - React-RCTBlob (= 0.64.0)\n- - React-RCTImage (= 0.64.0)\n- - React-RCTLinking (= 0.64.0)\n- - React-RCTNetwork (= 0.64.0)\n- - React-RCTSettings (= 0.64.0)\n- - React-RCTText (= 0.64.0)\n- - React-RCTVibration (= 0.64.0)\n- - React-callinvoker (0.64.0)\n- - React-Core (0.64.0):\n+ - RCTRequired (= 0.64.2)\n+ - React-Core (= 0.64.2)\n+ - React (0.64.2):\n+ - React-Core (= 0.64.2)\n+ - React-Core/DevSupport (= 0.64.2)\n+ - React-Core/RCTWebSocket (= 0.64.2)\n+ - React-RCTActionSheet (= 0.64.2)\n+ - React-RCTAnimation (= 0.64.2)\n+ - React-RCTBlob (= 0.64.2)\n+ - React-RCTImage (= 0.64.2)\n+ - React-RCTLinking (= 0.64.2)\n+ - React-RCTNetwork (= 0.64.2)\n+ - React-RCTSettings (= 0.64.2)\n+ - React-RCTText (= 0.64.2)\n+ - React-RCTVibration (= 0.64.2)\n+ - React-callinvoker (0.64.2)\n+ - React-Core (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-Core/Default (= 0.64.0)\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-Core/Default (= 0.64.2)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/CoreModulesHeaders (0.64.0):\n+ - React-Core/CoreModulesHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/Default (0.64.0):\n+ - React-Core/Default (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/DevSupport (0.64.0):\n+ - React-Core/DevSupport (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-Core/Default (= 0.64.0)\n- - React-Core/RCTWebSocket (= 0.64.0)\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-jsinspector (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-Core/Default (= 0.64.2)\n+ - React-Core/RCTWebSocket (= 0.64.2)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-jsinspector (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTActionSheetHeaders (0.64.0):\n+ - React-Core/RCTActionSheetHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTAnimationHeaders (0.64.0):\n+ - React-Core/RCTAnimationHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTBlobHeaders (0.64.0):\n+ - React-Core/RCTBlobHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTImageHeaders (0.64.0):\n+ - React-Core/RCTImageHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTLinkingHeaders (0.64.0):\n+ - React-Core/RCTLinkingHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTNetworkHeaders (0.64.0):\n+ - React-Core/RCTNetworkHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTSettingsHeaders (0.64.0):\n+ - React-Core/RCTSettingsHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTTextHeaders (0.64.0):\n+ - React-Core/RCTTextHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTVibrationHeaders (0.64.0):\n+ - React-Core/RCTVibrationHeaders (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- React-Core/Default\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-Core/RCTWebSocket (0.64.0):\n+ - React-Core/RCTWebSocket (0.64.2):\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-Core/Default (= 0.64.0)\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsiexecutor (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-Core/Default (= 0.64.2)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- Yoga\n- - React-CoreModules (0.64.0):\n- - FBReactNativeSpec (= 0.64.0)\n+ - React-CoreModules (0.64.2):\n+ - FBReactNativeSpec (= 0.64.2)\n- RCT-Folly (= 2021.04.26.00)\n- - RCTTypeSafety (= 0.64.0)\n- - React-Core/CoreModulesHeaders (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-RCTImage (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n- - React-cxxreact (0.64.0):\n+ - RCTTypeSafety (= 0.64.2)\n+ - React-Core/CoreModulesHeaders (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-RCTImage (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n+ - React-cxxreact (0.64.2):\n- boost-for-react-native (= 1.63.0)\n- DoubleConversion\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-callinvoker (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-jsinspector (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n- - React-runtimeexecutor (= 0.64.0)\n- - React-jsi (0.64.0):\n+ - React-callinvoker (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsinspector (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n+ - React-runtimeexecutor (= 0.64.2)\n+ - React-jsi (0.64.2):\n- boost-for-react-native (= 1.63.0)\n- DoubleConversion\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-jsi/Default (= 0.64.0)\n- - React-jsi/Default (0.64.0):\n+ - React-jsi/Default (= 0.64.2)\n+ - React-jsi/Default (0.64.2):\n- boost-for-react-native (= 1.63.0)\n- DoubleConversion\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-jsiexecutor (0.64.0):\n+ - React-jsiexecutor (0.64.2):\n- DoubleConversion\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n- - React-jsinspector (0.64.0)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n+ - React-jsinspector (0.64.2)\n- react-native-background-upload (5.6.0):\n- React\n- react-native-camera (3.31.0):\n@@ -342,70 +342,70 @@ PODS:\n- React\n- react-native-video/Video\n- SPTPersistentCache (~> 1.1.0)\n- - React-perflogger (0.64.0)\n- - React-RCTActionSheet (0.64.0):\n- - React-Core/RCTActionSheetHeaders (= 0.64.0)\n- - React-RCTAnimation (0.64.0):\n- - FBReactNativeSpec (= 0.64.0)\n+ - React-perflogger (0.64.2)\n+ - React-RCTActionSheet (0.64.2):\n+ - React-Core/RCTActionSheetHeaders (= 0.64.2)\n+ - React-RCTAnimation (0.64.2):\n+ - FBReactNativeSpec (= 0.64.2)\n- RCT-Folly (= 2021.04.26.00)\n- - RCTTypeSafety (= 0.64.0)\n- - React-Core/RCTAnimationHeaders (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n- - React-RCTBlob (0.64.0):\n- - FBReactNativeSpec (= 0.64.0)\n+ - RCTTypeSafety (= 0.64.2)\n+ - React-Core/RCTAnimationHeaders (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n+ - React-RCTBlob (0.64.2):\n+ - FBReactNativeSpec (= 0.64.2)\n- RCT-Folly (= 2021.04.26.00)\n- - React-Core/RCTBlobHeaders (= 0.64.0)\n- - React-Core/RCTWebSocket (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-RCTNetwork (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n- - React-RCTImage (0.64.0):\n- - FBReactNativeSpec (= 0.64.0)\n+ - React-Core/RCTBlobHeaders (= 0.64.2)\n+ - React-Core/RCTWebSocket (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-RCTNetwork (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n+ - React-RCTImage (0.64.2):\n+ - FBReactNativeSpec (= 0.64.2)\n- RCT-Folly (= 2021.04.26.00)\n- - RCTTypeSafety (= 0.64.0)\n- - React-Core/RCTImageHeaders (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-RCTNetwork (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n- - React-RCTLinking (0.64.0):\n- - FBReactNativeSpec (= 0.64.0)\n- - React-Core/RCTLinkingHeaders (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n- - React-RCTNetwork (0.64.0):\n- - FBReactNativeSpec (= 0.64.0)\n+ - RCTTypeSafety (= 0.64.2)\n+ - React-Core/RCTImageHeaders (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-RCTNetwork (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n+ - React-RCTLinking (0.64.2):\n+ - FBReactNativeSpec (= 0.64.2)\n+ - React-Core/RCTLinkingHeaders (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n+ - React-RCTNetwork (0.64.2):\n+ - FBReactNativeSpec (= 0.64.2)\n- RCT-Folly (= 2021.04.26.00)\n- - RCTTypeSafety (= 0.64.0)\n- - React-Core/RCTNetworkHeaders (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n- - React-RCTSettings (0.64.0):\n- - FBReactNativeSpec (= 0.64.0)\n+ - RCTTypeSafety (= 0.64.2)\n+ - React-Core/RCTNetworkHeaders (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n+ - React-RCTSettings (0.64.2):\n+ - FBReactNativeSpec (= 0.64.2)\n- RCT-Folly (= 2021.04.26.00)\n- - RCTTypeSafety (= 0.64.0)\n- - React-Core/RCTSettingsHeaders (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n- - React-RCTText (0.64.0):\n- - React-Core/RCTTextHeaders (= 0.64.0)\n- - React-RCTVibration (0.64.0):\n- - FBReactNativeSpec (= 0.64.0)\n+ - RCTTypeSafety (= 0.64.2)\n+ - React-Core/RCTSettingsHeaders (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n+ - React-RCTText (0.64.2):\n+ - React-Core/RCTTextHeaders (= 0.64.2)\n+ - React-RCTVibration (0.64.2):\n+ - FBReactNativeSpec (= 0.64.2)\n- RCT-Folly (= 2021.04.26.00)\n- - React-Core/RCTVibrationHeaders (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - ReactCommon/turbomodule/core (= 0.64.0)\n- - React-runtimeexecutor (0.64.0):\n- - React-jsi (= 0.64.0)\n- - ReactCommon/turbomodule/core (0.64.0):\n+ - React-Core/RCTVibrationHeaders (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - ReactCommon/turbomodule/core (= 0.64.2)\n+ - React-runtimeexecutor (0.64.2):\n+ - React-jsi (= 0.64.2)\n+ - ReactCommon/turbomodule/core (0.64.2):\n- DoubleConversion\n- glog\n- RCT-Folly (= 2021.04.26.00)\n- - React-callinvoker (= 0.64.0)\n- - React-Core (= 0.64.0)\n- - React-cxxreact (= 0.64.0)\n- - React-jsi (= 0.64.0)\n- - React-perflogger (= 0.64.0)\n+ - React-callinvoker (= 0.64.2)\n+ - React-Core (= 0.64.2)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- ReactNativeART (1.2.0):\n- React\n- ReactNativeDarkMode (0.2.0-rc.1):\n@@ -484,7 +484,7 @@ DEPENDENCIES:\n- FBReactNativeSpec (from `../../node_modules/react-native/React/FBReactNativeSpec`)\n- Flipper (= 0.87.0)\n- Flipper-DoubleConversion (= 1.1.7)\n- - Flipper-Folly (~> 2.5)\n+ - Flipper-Folly (~> 2.5.3)\n- Flipper-Glog (= 0.3.6)\n- Flipper-PeerTalk (~> 0.0.4)\n- Flipper-RSocket (~> 1.3)\n@@ -764,8 +764,8 @@ SPEC CHECKSUMS:\nEXMediaLibrary: 580c097a85f9253deaaf7aaa75a8a2e692e9d8b9\nEXPermissions: 24b97f734ce9172d245a5be38ad9ccfcb6135964\nEXSplashScreen: c4ed5d39cd5dbc1329f8dec720e280276bafa28b\n- FBLazyVector: 49cbe4b43e445b06bf29199b6ad2057649e4c8f5\n- FBReactNativeSpec: e70e2235774c20416564d24d53d9a69a7abbcbb2\n+ FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b\n+ FBReactNativeSpec: 00d3c44d268b294f240a43ff003e918ff9f510e2\nFlipper: 1bd2db48dcc31e4b167b9a33ec1df01c2ded4893\nFlipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41\nFlipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c\n@@ -783,16 +783,16 @@ SPEC CHECKSUMS:\nOLMKit: a15f216aa14ba199b4fd827b3d7ef04629b56636\nOpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b\nRCT-Folly: a9c51bfbf65605ded97cf280089c71ce1e886fea\n- RCTRequired: 2f8cb5b7533219bf4218a045f92768129cf7050a\n- RCTTypeSafety: 05e03dbd833af710de3bd73bcaa12d82c076f855\n- React: 98eac01574128a790f0bbbafe2d1a8607291ac24\n- React-callinvoker: def3f7fae16192df68d9b69fd4bbb59092ee36bc\n- React-Core: 2af3bc1f2c416007d92dc452a58538c4e647162a\n- React-CoreModules: d4bd38b4926304e8e53ecda6295d1cb24a53ef90\n- React-cxxreact: 5eb9754b2b62a0012d8b3b92139c3c6cbe338f4e\n- React-jsi: 633610cb5c9df5c59ad1577ee61bae9c15d84f30\n- React-jsiexecutor: df70f21739654252820c7558a0fd375239963292\n- React-jsinspector: 0ae35a37b20d5e031eb020a69cc5afdbd6406301\n+ RCTRequired: 6d3e854f0e7260a648badd0d44fc364bc9da9728\n+ RCTTypeSafety: ce770581b51b0138d8e27fd1650d0a7b05e407e0\n+ React: bda6b6d7ae912de97d7a61aa5c160db24aa2ad69\n+ React-callinvoker: 9840ea7e8e88ed73d438edb725574820b29b5baa\n+ React-Core: d98ffa4ed50b1df6784a434675c57d8b3fcc7f9a\n+ React-CoreModules: 52019480c079764a596a7be2e794b5960a24082b\n+ React-cxxreact: 489e677b30019f404830c897f051d4868fb4496e\n+ React-jsi: a9845edcbf60f702c2064476810496af82eee596\n+ React-jsiexecutor: e4842a1d236bbdf029095cc55b63c99788a5e7ae\n+ React-jsinspector: cc614ec18a9ca96fd275100c16d74d62ee11f0ae\nreact-native-background-upload: 6e8ba7f41a6308231306bddc88f11da3b74c9de4\nreact-native-camera: b5c8c7a71feecfdd5b39f0dbbf6b64b957ed55f2\nreact-native-ffmpeg: f9a60452aaa5d478aac205b248224994f3bde416\n@@ -803,18 +803,18 @@ SPEC CHECKSUMS:\nreact-native-orientation-locker: 23918c400376a7043e752c639c122fcf6bce8f1c\nreact-native-safe-area-context: b6e0e284002381d2ff29fa4fff42b4d8282e3c94\nreact-native-video: d01ed7ff1e38fa7dcc6c15c94cf505e661b7bfd0\n- React-perflogger: 9c547d8f06b9bf00cb447f2b75e8d7f19b7e02af\n- React-RCTActionSheet: 3080b6e12e0e1a5b313c8c0050699b5c794a1b11\n- React-RCTAnimation: be746ce158be41d00ede2f6ea5d916d311bc721b\n- React-RCTBlob: a433b3ab0f149a0587f0d309e31455ef8bc2992c\n- React-RCTImage: 258a8f0391de9b2b2dee87c8ebd2660d83653bf3\n- React-RCTLinking: 5e8fbb3e9a8bc2e4e3eb15b1eb8bda5fcac27b8c\n- React-RCTNetwork: e75f79bcf94d05dce72ad60d20c7feaad473bfb2\n- React-RCTSettings: 16c0986a620afb7ebc1398e918823246f0d293e5\n- React-RCTText: 8746736ac8eb5a4a74719aa695b7a236a93a83d2\n- React-RCTVibration: 5042d9c80158c63c87035347f960abe88d304dab\n- React-runtimeexecutor: cad74a1eaa53ee6e7a3620231939d8fe2c6afcf0\n- ReactCommon: be69ea839a65b9988a4b4c0dc660d947a8e7f4ab\n+ React-perflogger: 25373e382fed75ce768a443822f07098a15ab737\n+ React-RCTActionSheet: af7796ba49ffe4ca92e7277a5d992d37203f7da5\n+ React-RCTAnimation: b5420d8fe5b8e093f652211f12dbad4412d2dfe0\n+ React-RCTBlob: 964af5906f1d29daa36c44b599b1c66d1fb54430\n+ React-RCTImage: be7ee5ab6a32bba377a150100470a02bd763cecb\n+ React-RCTLinking: ccd20742de14e020cb5f99d5c7e0bf0383aefbd9\n+ React-RCTNetwork: a3ece3ccc3dcc32ab2a4291f197946dd970414ee\n+ React-RCTSettings: ba385d4cea028d266cec8ba3db09968ad506f5f8\n+ React-RCTText: 41a2e952dd9adc5caf6fb68ed46b275194d5da5f\n+ React-RCTVibration: bd3d387c85b5e6c57f4298ad0c7920a2a151a795\n+ React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9\n+ ReactCommon: 8ca93f784331813b121137f4893720ef3ed054d6\nReactNativeART: 78edc68dd4a1e675338cd0cd113319cf3a65f2ab\nReactNativeDarkMode: 88317ff05ba95fd063dd347ad32f8c4cefd3166c\nReactNativeKeyboardInput: 266ba27a2e9921f5bdc0b4cc30289b2a2f46b157\n@@ -848,7 +848,7 @@ SPEC CHECKSUMS:\nUMReactNativeAdapter: 126da3486c1a1f11945b649d557d6c2ebb9407b2\nUMSensorsInterface: 48941f70175e2975af1a9386c6d6cb16d8126805\nUMTaskManagerInterface: cb890c79c63885504ddc0efd7a7d01481760aca2\n- Yoga: 8c8436d4171c87504c648ae23b1d81242bdf3bbf\n+ Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac\nYogaKit: f782866e155069a2cca2517aafea43200b01fd5a\nPODFILE CHECKSUM: 78f6e199959e13aed06f7cfddd9cea01f2ca8f3c\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"md5\": \"^2.2.1\",\n\"olm\": \"git+https://gitlab.matrix.org/matrix-org/olm.git#v3.2.4\",\n\"react\": \"17.0.1\",\n- \"react-native\": \"0.64.0\",\n+ \"react-native\": \"0.64.2\",\n\"react-native-background-upload\": \"^5.6.0\",\n\"react-native-camera\": \"^3.31.0\",\n\"react-native-dark-mode\": \"^0.2.0-rc.1\",\n" }, { "change_type": "RENAME", "old_path": "patches/react-native+0.64.0.patch", "new_path": "patches/react-native+0.64.2.patch", "diff": "" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "slash \"^3.0.0\"\nxmldoc \"^1.1.2\"\n-\"@react-native-community/cli-platform-android@^5.0.1\", \"@react-native-community/cli-platform-android@^5.0.1-alpha.0\":\n+\"@react-native-community/cli-platform-android@^5.0.1\", \"@react-native-community/cli-platform-android@^5.0.1-alpha.1\":\nversion \"5.0.1\"\nresolved \"https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-5.0.1.tgz#7f761e1818e5a099877ec59a1b739553fd6a6905\"\nintegrity sha512-qv9GJX6BJ+Y4qvV34vgxKwwN1cnveXUdP6y2YmTW7XoAYs5YUzKqHajpY58EyucAL2y++6+573t5y4U/9IIoww==\nplist \"^3.0.1\"\nxcode \"^2.0.0\"\n-\"@react-native-community/cli-platform-ios@^5.0.1-alpha.0\":\n+\"@react-native-community/cli-platform-ios@^5.0.1-alpha.1\":\nversion \"5.0.1\"\nresolved \"https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-5.0.1.tgz#efa9c9b3bba0978d0a26d6442eefeffb5006a196\"\nintegrity sha512-Nr/edBEYJfElgBNvjDevs2BuDicsvQaM8nYkTGgp33pyuCZRBxsYxQqfsNmnLalTzcYaebjWj6AnjUSxzQBWqg==\ndependencies:\nora \"^3.4.0\"\n-\"@react-native-community/cli@^5.0.1-alpha.0\":\n+\"@react-native-community/cli@^5.0.1-alpha.1\":\nversion \"5.0.1\"\nresolved \"https://registry.yarnpkg.com/@react-native-community/cli/-/cli-5.0.1.tgz#1f7a66d813d5daf102e593f3c550650fa0cc8314\"\nintegrity sha512-9VzSYUYSEqxEH5Ib2UNSdn2eyPiYZ4T7Y79o9DKtRBuSaUIwbCUdZtIm+UUjBpLS1XYBkW26FqL8/UdZDmQvXw==\n@@ -14258,15 +14258,15 @@ react-native-video@^5.0.2:\nprop-types \"^15.5.10\"\nshaka-player \"^2.4.4\"\n-react-native@0.64.0:\n- version \"0.64.0\"\n- resolved \"https://registry.yarnpkg.com/react-native/-/react-native-0.64.0.tgz#c3bde5b638bf8bcf12bae6e094930d39cb942ab7\"\n- integrity sha512-8dhSHBthgGwAjU+OjqUEA49229ThPMQH7URH0u8L0xoQFCnZO2sZ9Wc6KcbxI0x9KSmjCMFFZqRe3w3QsRv64g==\n+react-native@0.64.2:\n+ version \"0.64.2\"\n+ resolved \"https://registry.yarnpkg.com/react-native/-/react-native-0.64.2.tgz#233b6ed84ac4749c8bc2a2d6cf63577a1c437d18\"\n+ integrity sha512-Ty/fFHld9DcYsFZujXYdeVjEhvSeQcwuTGXezyoOkxfiGEGrpL/uwUZvMzwShnU4zbbTKDu2PAm/uwuOittRGA==\ndependencies:\n\"@jest/create-cache-key-function\" \"^26.5.0\"\n- \"@react-native-community/cli\" \"^5.0.1-alpha.0\"\n- \"@react-native-community/cli-platform-android\" \"^5.0.1-alpha.0\"\n- \"@react-native-community/cli-platform-ios\" \"^5.0.1-alpha.0\"\n+ \"@react-native-community/cli\" \"^5.0.1-alpha.1\"\n+ \"@react-native-community/cli-platform-android\" \"^5.0.1-alpha.1\"\n+ \"@react-native-community/cli-platform-ios\" \"^5.0.1-alpha.1\"\n\"@react-native/assets\" \"1.0.0\"\n\"@react-native/normalize-color\" \"1.0.0\"\n\"@react-native/polyfills\" \"1.0.0\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update to react-native@0.64.2 Test Plan: Tested in combination with following diffs Reviewers: atul, palys-swm, karol-bisztyga Reviewed By: atul Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1752
129,187
17.07.2021 01:17:39
14,400
faef6f5449e45cb54f2b892a3da9ed8c5346b288
[native] Enable Hermes on iOS Test Plan: 1. Compile and run iOS in debug and release 2. Confirm Hermes is running via `global.HermesInternal` 3. In debug, make sure Hermes can connect with Flipper debugger Reviewers: atul, palys-swm, karol-bisztyga Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Comm.xcodeproj/project.pbxproj", "new_path": "native/ios/Comm.xcodeproj/project.pbxproj", "diff": ");\ninputPaths = (\n\"${PODS_ROOT}/Target Support Files/Pods-Comm/Pods-Comm-frameworks.sh\",\n+ \"${PODS_ROOT}/hermes-engine/destroot/Library/Frameworks/iphoneos/hermes.framework\",\n\"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL\",\n);\nname = \"[CP] Embed Pods Frameworks\";\noutputPaths = (\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework\",\n);\nrunOnlyForDeploymentPostprocessing = 0;\nCOPY_PHASE_STRIP = NO;\nENABLE_STRICT_OBJC_MSGSEND = YES;\nENABLE_TESTABILITY = YES;\n- \"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"\";\n+ \"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = i386;\nGCC_C_LANGUAGE_STANDARD = gnu99;\nGCC_DYNAMIC_NO_PIC = NO;\nGCC_NO_COMMON_BLOCKS = YES;\nCOPY_PHASE_STRIP = YES;\nENABLE_NS_ASSERTIONS = NO;\nENABLE_STRICT_OBJC_MSGSEND = YES;\n- \"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"\";\n+ \"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = i386;\nGCC_C_LANGUAGE_STANDARD = gnu99;\nGCC_NO_COMMON_BLOCKS = YES;\nGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/AppDelegate.mm", "new_path": "native/ios/Comm/AppDelegate.mm", "diff": "#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>\n#import <EXSplashScreen/EXSplashScreenService.h>\n-#import <React/JSCExecutorFactory.h>\n+#import <reacthermes/HermesExecutorFactory.h>\n#import <React/RCTCxxBridgeDelegate.h>\n#import <React/RCTJSIExecutorRuntimeInstaller.h>\n#import <cxxreact/JSExecutor.h>\n@@ -128,7 +128,7 @@ static void InitializeFlipper(UIApplication *application) {\n#endif\n}\n-using ExecutorFactory = facebook::react::JSCExecutorFactory;\n+using ExecutorFactory = facebook::react::HermesExecutorFactory;\nusing Runtime = facebook::jsi::Runtime;\n- (std::unique_ptr<ExecutorFactory>)jsExecutorFactoryForBridge\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile", "new_path": "native/ios/Podfile", "diff": "@@ -14,7 +14,7 @@ target 'Comm' do\nuse_react_native!(\n:path => config[:reactNativePath],\n# to enable hermes on iOS, change `false` to `true` and then install pods\n- :hermes_enabled => false\n+ :hermes_enabled => true\n)\nuse_unimodules!(modules_paths: ['../..'])\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -97,6 +97,7 @@ PODS:\n- FlipperKit/FlipperKitNetworkPlugin\n- fmt (6.2.1)\n- glog (0.3.5)\n+ - hermes-engine (0.7.2)\n- libevent (2.1.12)\n- libwebp (1.2.0):\n- libwebp/demux (= 1.2.0)\n@@ -129,6 +130,12 @@ PODS:\n- DoubleConversion\n- fmt (~> 6.2.1)\n- glog\n+ - RCT-Folly/Futures (2021.04.26.00):\n+ - boost-for-react-native\n+ - DoubleConversion\n+ - fmt (~> 6.2.1)\n+ - glog\n+ - libevent\n- RCTRequired (0.64.2)\n- RCTTypeSafety (0.64.2):\n- FBLazyVector (= 0.64.2)\n@@ -294,6 +301,17 @@ PODS:\n- React-jsinspector (= 0.64.2)\n- React-perflogger (= 0.64.2)\n- React-runtimeexecutor (= 0.64.2)\n+ - React-hermes (0.64.2):\n+ - DoubleConversion\n+ - glog\n+ - hermes-engine\n+ - RCT-Folly (= 2021.04.26.00)\n+ - RCT-Folly/Futures (= 2021.04.26.00)\n+ - React-cxxreact (= 0.64.2)\n+ - React-jsi (= 0.64.2)\n+ - React-jsiexecutor (= 0.64.2)\n+ - React-jsinspector (= 0.64.2)\n+ - React-perflogger (= 0.64.2)\n- React-jsi (0.64.2):\n- boost-for-react-native (= 1.63.0)\n- DoubleConversion\n@@ -505,6 +523,8 @@ DEPENDENCIES:\n- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.98.0)\n- FlipperKit/SKIOSNetworkPlugin (= 0.98.0)\n- glog (from `../../node_modules/react-native/third-party-podspecs/glog.podspec`)\n+ - hermes-engine (~> 0.7.2)\n+ - libevent (~> 2.1.12)\n- lottie-ios (from `../../node_modules/lottie-ios`)\n- lottie-react-native (from `../../node_modules/lottie-react-native`)\n- OLMKit (from `../../node_modules/olm`)\n@@ -518,6 +538,7 @@ DEPENDENCIES:\n- React-Core/RCTWebSocket (from `../../node_modules/react-native/`)\n- React-CoreModules (from `../../node_modules/react-native/React/CoreModules`)\n- React-cxxreact (from `../../node_modules/react-native/ReactCommon/cxxreact`)\n+ - React-hermes (from `../../node_modules/react-native/ReactCommon/hermes`)\n- React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)\n- React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n@@ -590,6 +611,7 @@ SPEC REPOS:\n- Flipper-RSocket\n- FlipperKit\n- fmt\n+ - hermes-engine\n- libevent\n- libwebp\n- mobile-ffmpeg-min\n@@ -644,6 +666,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native/React/CoreModules\"\nReact-cxxreact:\n:path: \"../../node_modules/react-native/ReactCommon/cxxreact\"\n+ React-hermes:\n+ :path: \"../../node_modules/react-native/ReactCommon/hermes\"\nReact-jsi:\n:path: \"../../node_modules/react-native/ReactCommon/jsi\"\nReact-jsiexecutor:\n@@ -782,6 +806,7 @@ SPEC CHECKSUMS:\nFlipperKit: 2c7cd44efce216d1aeb165a0dca5e29877a92cc5\nfmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9\nglog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62\n+ hermes-engine: 7d97ba46a1e29bacf3e3c61ecb2804a5ddd02d4f\nlibevent: 4049cae6c81cdb3654a443be001fb9bdceff7913\nlibwebp: e90b9c01d99205d03b6bb8f2c8c415e5a4ef66f0\nlottie-ios: 48fac6be217c76937e36e340e2d09cf7b10b7f5f\n@@ -797,6 +822,7 @@ SPEC CHECKSUMS:\nReact-Core: d98ffa4ed50b1df6784a434675c57d8b3fcc7f9a\nReact-CoreModules: 52019480c079764a596a7be2e794b5960a24082b\nReact-cxxreact: 489e677b30019f404830c897f051d4868fb4496e\n+ React-hermes: 4a096408e0b8a8957fc701fa95888417c496612a\nReact-jsi: a9845edcbf60f702c2064476810496af82eee596\nReact-jsiexecutor: e4842a1d236bbdf029095cc55b63c99788a5e7ae\nReact-jsinspector: cc614ec18a9ca96fd275100c16d74d62ee11f0ae\n@@ -858,6 +884,6 @@ SPEC CHECKSUMS:\nYoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac\nYogaKit: f782866e155069a2cca2517aafea43200b01fd5a\n-PODFILE CHECKSUM: 2fbb50bfcc54ad0800264c5b21b22bacf8bb84d2\n+PODFILE CHECKSUM: aa2c782b4c5325e07800f165d9bacc1c475b9fbb\nCOCOAPODS: 1.10.1\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Enable Hermes on iOS Test Plan: 1. Compile and run iOS in debug and release 2. Confirm Hermes is running via `global.HermesInternal` 3. In debug, make sure Hermes can connect with Flipper debugger Reviewers: atul, palys-swm, karol-bisztyga Reviewed By: atul Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1754
129,187
17.07.2021 17:34:23
14,400
80c81dd3896f4812359d07e1730550973c586cdf
[native] Update to Summary: Deleting and regenerating `Podfile.lock` to pick up newer version of `SDWebImage`. Test Plan: Compile and run iOS in debug and release Reviewers: atul, palys-swm, karol-bisztyga Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -464,9 +464,9 @@ PODS:\n- React\n- RNVectorIcons (6.6.0):\n- React\n- - SDWebImage (5.9.3):\n- - SDWebImage/Core (= 5.9.3)\n- - SDWebImage/Core (5.9.3)\n+ - SDWebImage (5.11.1):\n+ - SDWebImage/Core (= 5.11.1)\n+ - SDWebImage/Core (5.11.1)\n- SDWebImageWebPCoder (0.6.1):\n- libwebp (~> 1.0)\n- SDWebImage/Core (~> 5.7)\n@@ -865,7 +865,7 @@ SPEC CHECKSUMS:\nRNScreens: 2e278a90eb15092ed261d4f2271e3fc9b60d08d4\nRNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f\nRNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4\n- SDWebImage: a31ee8e90a97303529e03fb0c333eae0eacb88e9\n+ SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d\nSDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21\nSPTPersistentCache: df36ea46762d7cf026502bbb86a8b79d0080dff4\nUMAppLoader: 90273a65f9b1d789214e0c913dfcabc7a1b1590e\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update to SDWebImage@5.11.1 Summary: Deleting and regenerating `Podfile.lock` to pick up newer version of `SDWebImage`. Test Plan: Compile and run iOS in debug and release Reviewers: atul, palys-swm, karol-bisztyga Reviewed By: atul Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1755
129,190
19.07.2021 08:55:25
-7,200
9fb9b7cd02145d144dc662474624c77b0690fe92
[native] public keys - Add creator and deleter Summary: Add creator and deleter for one-time keys Test Plan: testing code is in D1582 Reviewers: palys-swm, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul
[ { "change_type": "ADD", "old_path": null, "new_path": "server/src/creators/one-time-keys-creator.js", "diff": "+// @flow\n+\n+import { dbQuery, SQL } from '../database/database';\n+import type { Viewer } from '../session/viewer';\n+\n+async function saveOneTimeKeys(\n+ viewer: Viewer,\n+ oneTimeKeys: $ReadOnlyArray<string>,\n+): Promise<void> {\n+ if (oneTimeKeys.length === 0) {\n+ return;\n+ }\n+\n+ const insertData = oneTimeKeys.map(oneTimeKey => [viewer.userID, oneTimeKey]);\n+\n+ const query = SQL`\n+ INSERT INTO one_time_keys(user, one_time_key)\n+ VALUES ${insertData}\n+ `;\n+ await dbQuery(query);\n+}\n+\n+export { saveOneTimeKeys };\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/src/deleters/one-time-key-deleters.js", "diff": "+// @flow\n+\n+import { dbQuery, SQL } from '../database/database';\n+\n+async function deleteOneTimeKey(\n+ userID: string,\n+ oneTimeKey: string,\n+): Promise<void> {\n+ await dbQuery(SQL`\n+ DELETE\n+ FROM one_time_keys\n+ WHERE user = ${userID} AND one_time_key = ${oneTimeKey}\n+ `);\n+}\n+\n+export { deleteOneTimeKey };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] public keys - Add creator and deleter Summary: Add creator and deleter for one-time keys Test Plan: testing code is in D1582 Reviewers: palys-swm, ashoat Reviewed By: palys-swm, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1579
129,190
19.07.2021 10:11:34
-7,200
26209e09f0a93fadd02b667ff1830b7c97d68f53
[native] public keys - add types Summary: Add types for user's public identity keys and one-time keys Test Plan: testing code is in D1582 Reviewers: palys-swm, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "lib/types/request-types.js", "new_path": "lib/types/request-types.js", "diff": "@@ -30,6 +30,7 @@ export const serverRequestTypes = Object.freeze({\nENTRY_INCONSISTENCY: 5,\nCHECK_STATE: 6,\nINITIAL_ACTIVITY_UPDATES: 7,\n+ MORE_ONE_TIME_KEYS: 8,\n});\ntype ServerRequestType = $Values<typeof serverRequestTypes>;\nexport function assertServerRequestType(\n@@ -41,7 +42,8 @@ export function assertServerRequestType(\nserverRequestType === 3 ||\nserverRequestType === 5 ||\nserverRequestType === 6 ||\n- serverRequestType === 7,\n+ serverRequestType === 7 ||\n+ serverRequestType === 8,\n'number is not ServerRequestType enum',\n);\nreturn serverRequestType;\n@@ -101,17 +103,27 @@ type InitialActivityUpdatesClientResponse = {\n+activityUpdates: $ReadOnlyArray<ActivityUpdate>,\n};\n+type MoreOneTimeKeysServerRequest = {\n+ +type: 8,\n+};\n+type MoreOneTimeKeysClientResponse = {\n+ +type: 8,\n+ +keys: $ReadOnlyArray<string>,\n+};\n+\nexport type ServerServerRequest =\n| PlatformServerRequest\n| PlatformDetailsServerRequest\n- | ServerCheckStateServerRequest;\n+ | ServerCheckStateServerRequest\n+ | MoreOneTimeKeysServerRequest;\nexport type ClientResponse =\n| PlatformClientResponse\n| ThreadInconsistencyClientResponse\n| PlatformDetailsClientResponse\n| EntryInconsistencyClientResponse\n| CheckStateClientResponse\n- | InitialActivityUpdatesClientResponse;\n+ | InitialActivityUpdatesClientResponse\n+ | MoreOneTimeKeysClientResponse;\nexport type ClientCheckStateServerRequest = {\n+type: 6,\n@@ -134,7 +146,8 @@ export type ClientCheckStateServerRequest = {\nexport type ClientServerRequest =\n| PlatformServerRequest\n| PlatformDetailsServerRequest\n- | ClientCheckStateServerRequest;\n+ | ClientCheckStateServerRequest\n+ | MoreOneTimeKeysServerRequest;\n// This is just the client variant of ClientResponse. The server needs to handle\n// multiple client versions so the type supports old versions of certain client\n@@ -153,7 +166,8 @@ export type ClientClientResponse =\n| PlatformDetailsClientResponse\n| ClientEntryInconsistencyClientResponse\n| CheckStateClientResponse\n- | InitialActivityUpdatesClientResponse;\n+ | InitialActivityUpdatesClientResponse\n+ | MoreOneTimeKeysClientResponse;\nexport type ClientInconsistencyResponse =\n| ClientThreadInconsistencyClientResponse\n" }, { "change_type": "MODIFY", "old_path": "lib/types/user-types.js", "new_path": "lib/types/user-types.js", "diff": "@@ -72,3 +72,8 @@ export type UserListItem = {\n+alertText?: string,\n+alertTitle?: string,\n};\n+\n+export type UserPublicKeys = {\n+ +identityKey: string,\n+ +oneTimeKey?: string,\n+};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] public keys - add types Summary: Add types for user's public identity keys and one-time keys Test Plan: testing code is in D1582 Reviewers: palys-swm, ashoat Reviewed By: palys-swm, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1580
129,190
19.07.2021 10:11:56
-7,200
3f4c683e0ab59b5d63fa6b02a8404047cb9f3940
[native] public keys - add fetcher, responder, endpoints Summary: todo Test Plan: testing code is in D1582 Reviewers: palys-swm, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "lib/types/endpoints.js", "new_path": "lib/types/endpoints.js", "diff": "@@ -75,6 +75,7 @@ const socketPreferredEndpoints = Object.freeze({\nCREATE_MULTIMEDIA_MESSAGE: 'create_multimedia_message',\nDELETE_UPLOAD: 'delete_upload',\nUPDATE_RELATIONSHIPS: 'update_relationships',\n+ GET_USER_PUBLIC_KEYS: 'get_user_public_keys',\n});\ntype SocketPreferredEndpoint = $Values<typeof socketPreferredEndpoints>;\n" }, { "change_type": "MODIFY", "old_path": "lib/types/request-types.js", "new_path": "lib/types/request-types.js", "diff": "@@ -178,3 +178,7 @@ export type ProcessServerRequestsPayload = {\n+serverRequests: $ReadOnlyArray<ClientServerRequest>,\n+calendarQuery: CalendarQuery,\n};\n+\n+export type GetUserPublicKeysArgs = {\n+ +userID: string,\n+};\n" }, { "change_type": "ADD", "old_path": null, "new_path": "lib/utils/crypto-utils.js", "diff": "+// @flow\n+\n+const minimumOneTimeKeysRequired = 10;\n+\n+export { minimumOneTimeKeysRequired };\n" }, { "change_type": "MODIFY", "old_path": "server/src/endpoints.js", "new_path": "server/src/endpoints.js", "diff": "@@ -17,6 +17,7 @@ import {\ncalendarQueryUpdateResponder,\n} from './responders/entry-responders';\nimport type { JSONResponder } from './responders/handlers';\n+import { getUserPublicKeysResponder } from './responders/keys-responders';\nimport {\ntextMessageCreationResponder,\nmessageFetchResponder,\n@@ -92,6 +93,7 @@ const jsonEndpoints: { [id: Endpoint]: JSONResponder } = {\ndelete_upload: uploadDeletionResponder,\ncreate_multimedia_message: multimediaMessageCreationResponder,\nupdate_relationships: updateRelationshipsResponder,\n+ get_user_public_keys: getUserPublicKeysResponder,\n};\nexport { jsonEndpoints };\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/src/fetchers/key-fetchers.js", "diff": "+// @flow\n+\n+import type { UserPublicKeys } from 'lib/types/user-types';\n+import { minimumOneTimeKeysRequired } from 'lib/utils/crypto-utils';\n+import { ServerError } from 'lib/utils/errors';\n+\n+import { dbQuery, SQL } from '../database/database';\n+import { deleteOneTimeKey } from '../deleters/one-time-key-deleters';\n+import type { Viewer } from '../session/viewer';\n+\n+async function checkIfUserHasEnoughOneTimeKeys(\n+ userID: string,\n+): Promise<boolean> {\n+ const query = SQL`\n+ SELECT COUNT(*) AS count\n+ FROM one_time_keys\n+ WHERE user = ${userID}\n+ `;\n+ const [queryResult] = await dbQuery(query);\n+ if (!queryResult.length || queryResult[0].count === undefined) {\n+ throw new ServerError('internal_error');\n+ }\n+ const [{ count }] = queryResult;\n+ return count >= minimumOneTimeKeysRequired;\n+}\n+\n+async function fetchUserPublicKeys(\n+ viewer: Viewer,\n+ userID: string,\n+): Promise<UserPublicKeys | null> {\n+ const query = SQL`\n+ SELECT u.public_key, otk.one_time_key\n+ FROM users u\n+ LEFT JOIN one_time_keys otk ON otk.user = u.id\n+ WHERE u.id = ${userID}\n+ LIMIT 1\n+ `;\n+ const [queryResult] = await dbQuery(query);\n+ if (!queryResult.length) {\n+ return null;\n+ }\n+ const [result] = queryResult;\n+\n+ if (!result.public_key) {\n+ return null;\n+ }\n+\n+ const oneTimeKey = result.one_time_key;\n+ const identityKey = result.public_key;\n+ await deleteOneTimeKey(userID, oneTimeKey);\n+\n+ return { identityKey, oneTimeKey };\n+}\n+\n+export { fetchUserPublicKeys, checkIfUserHasEnoughOneTimeKeys };\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/src/responders/keys-responders.js", "diff": "+// @flow\n+\n+import t from 'tcomb';\n+\n+import type { GetUserPublicKeysArgs } from 'lib/types/request-types';\n+import type { UserPublicKeys } from 'lib/types/user-types';\n+\n+import { fetchUserPublicKeys } from '../fetchers/key-fetchers';\n+import type { Viewer } from '../session/viewer';\n+import { validateInput, tShape } from '../utils/validation-utils';\n+\n+const getUserPublicKeysInputValidator = tShape({\n+ userID: t.String,\n+});\n+\n+async function getUserPublicKeysResponder(\n+ viewer: Viewer,\n+ input: any,\n+): Promise<UserPublicKeys | null> {\n+ if (!viewer.loggedIn) {\n+ return null;\n+ }\n+ const request: GetUserPublicKeysArgs = input;\n+ await validateInput(viewer, getUserPublicKeysInputValidator, request);\n+ return await fetchUserPublicKeys(viewer, request.userID);\n+}\n+\n+export { getUserPublicKeysResponder };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] public keys - add fetcher, responder, endpoints Summary: todo Test Plan: testing code is in D1582 Reviewers: palys-swm, ashoat Reviewed By: palys-swm, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1581
129,187
19.07.2021 22:13:58
14,400
0841660126a73a14099fe6ff550f2dde0b832fbb
[native] Update to Test Plan: Test iOS and Android and make sure animations still work Reviewers: karol-bisztyga, palys-swm Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -452,8 +452,8 @@ PODS:\n- SDWebImageWebPCoder (~> 0.6.1)\n- RNFS (2.15.2):\n- React\n- - RNGestureHandler (1.8.0):\n- - React\n+ - RNGestureHandler (1.10.3):\n+ - React-Core\n- RNKeychain (7.0.0):\n- React-Core\n- RNReanimated (2.2.0):\n@@ -886,7 +886,7 @@ SPEC CHECKSUMS:\nRNExitApp: c4e052df2568b43bec8a37c7cd61194d4cfee2c3\nRNFastImage: 2ed80661d5ef384fb1b539f1f3c81a1733f92bc9\nRNFS: 54da03c2b7d862c42ea3ca8c7f86f892760a535a\n- RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39\n+ RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211\nRNKeychain: f75b8c8b2f17d3b2aa1f25b4a0ac5b83d947ff8f\nRNReanimated: e7db9e2b56c09f5ceb4ade9e8b83c400804036c2\nRNScreens: 2e278a90eb15092ed261d4f2271e3fc9b60d08d4\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-firebase\": \"^5.6.0\",\n\"react-native-floating-action\": \"^1.21.0\",\n\"react-native-fs\": \"2.15.2\",\n- \"react-native-gesture-handler\": \"^1.8.0\",\n+ \"react-native-gesture-handler\": \"^1.10.3\",\n\"react-native-in-app-message\": \"^1.0.2\",\n\"react-native-keyboard-input\": \"6.0.1\",\n\"react-native-keychain\": \"^7.0.0\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -7857,6 +7857,19 @@ fbjs@^3.0.0:\nsetimmediate \"^1.0.5\"\nua-parser-js \"^0.7.18\"\n+fbjs@^3.0.0:\n+ version \"3.0.0\"\n+ resolved \"https://registry.yarnpkg.com/fbjs/-/fbjs-3.0.0.tgz#0907067fb3f57a78f45d95f1eacffcacd623c165\"\n+ integrity sha512-dJd4PiDOFuhe7vk4F80Mba83Vr2QuK86FoxtgPmzBqEJahncp+13YCmfoa53KHCo6OnlXLG7eeMWPfB5CrpVKg==\n+ dependencies:\n+ cross-fetch \"^3.0.4\"\n+ fbjs-css-vars \"^1.0.0\"\n+ loose-envify \"^1.0.0\"\n+ object-assign \"^4.1.0\"\n+ promise \"^7.1.1\"\n+ setimmediate \"^1.0.5\"\n+ ua-parser-js \"^0.7.18\"\n+\nfd-slicer@~1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e\"\n@@ -14136,12 +14149,13 @@ react-native-fs@2.15.2:\nbase-64 \"^0.1.0\"\nutf8 \"^3.0.0\"\n-react-native-gesture-handler@^1.8.0:\n- version \"1.8.0\"\n- resolved \"https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.8.0.tgz#18f61f51da50320f938957b0ee79bc58f47449dc\"\n- integrity sha512-E2FZa0qZ5Bi0Z8Jg4n9DaFomHvedSjwbO2DPmUUHYRy1lH2yxXUpSrqJd6yymu+Efzmjg2+JZzsjFYA2Iq8VEQ==\n+react-native-gesture-handler@^1.10.3:\n+ version \"1.10.3\"\n+ resolved \"https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.10.3.tgz#942bbf2963bbf49fa79593600ee9d7b5dab3cfc0\"\n+ integrity sha512-cBGMi1IEsIVMgoox4RvMx7V2r6bNKw0uR1Mu1o7NbuHS6BRSVLq0dP34l2ecnPlC+jpWd3le6Yg1nrdCjby2Mw==\ndependencies:\n\"@egjs/hammerjs\" \"^2.0.17\"\n+ fbjs \"^3.0.0\"\nhoist-non-react-statics \"^3.3.0\"\ninvariant \"^2.2.4\"\nprop-types \"^15.7.2\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Update to react-native-gesture-handler@1.10.3 Test Plan: Test iOS and Android and make sure animations still work Reviewers: karol-bisztyga, palys-swm Reviewed By: palys-swm Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1763
129,191
19.07.2021 11:06:09
-7,200
9d11a3c31cb53f6b582200f38898bb962f765089
[native] Move chatMessageItemHeight to utils Summary: We do this to avoid a require loop Test Plan: Open a thread and check if it is rendered correctly Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-list.react.js", "new_path": "native/chat/chat-list.react.js", "diff": "@@ -29,8 +29,8 @@ import type { ScrollEvent } from '../types/react-native';\nimport type { ViewStyle } from '../types/styles';\nimport type { ChatNavigationProp } from './chat.react';\nimport type { ChatMessageItemWithHeight } from './message-list-container.react';\n-import { messageItemHeight } from './message.react';\nimport NewMessagesPill from './new-messages-pill.react';\n+import { chatMessageItemHeight } from './utils';\nfunction chatMessageItemKey(\nitem: ChatMessageItemWithHeight | ChatMessageItem,\n@@ -41,13 +41,6 @@ function chatMessageItemKey(\nreturn messageKey(item.messageInfo);\n}\n-function chatMessageItemHeight(item: ChatMessageItemWithHeight): number {\n- if (item.itemType === 'loader') {\n- return 56;\n- }\n- return messageItemHeight(item);\n-}\n-\nconst animationSpec = {\nduration: 150,\nuseNativeDriver: true,\n@@ -319,8 +312,4 @@ const ConnectedChatList: React.ComponentType<BaseProps> = React.memo<BaseProps>(\n},\n);\n-export {\n- ConnectedChatList as ChatList,\n- chatMessageItemKey,\n- chatMessageItemHeight,\n-};\n+export { ConnectedChatList as ChatList, chatMessageItemKey };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/sidebar-navigation.js", "new_path": "native/chat/sidebar-navigation.js", "diff": "// @flow\n+import invariant from 'invariant';\n+\n+import { createPendingSidebar } from 'lib/shared/thread-utils';\n+import type { ThreadInfo } from 'lib/types/thread-types';\nimport type { DispatchFunctions, ActionFunc } from 'lib/utils/action-utils';\nimport type { InputState } from '../input/input-state';\n+import { getDefaultTextMessageRules } from '../markdown/rules.react';\nimport type { AppNavigationProp } from '../navigation/app-navigator.react';\nimport type { MessageTooltipRouteNames } from '../navigation/route-names';\nimport type { TooltipRoute } from '../navigation/tooltip.react';\nimport { setCurrentTransitionSidebarSourceIDType } from '../types/nav-types';\nimport { createNavigateToThreadAction } from './message-list-types';\n-import { getSidebarThreadInfo } from './utils';\n+import type { ChatMessageInfoItemWithHeight } from './message.react';\n+\n+function getSidebarThreadInfo(\n+ sourceMessage: ChatMessageInfoItemWithHeight,\n+ viewerID?: ?string,\n+): ThreadInfo {\n+ const threadCreatedFromMessage = sourceMessage.threadCreatedFromMessage;\n+ if (threadCreatedFromMessage) {\n+ return threadCreatedFromMessage;\n+ }\n+\n+ invariant(viewerID, 'viewerID should be set');\n+\n+ const { messageInfo, threadInfo } = sourceMessage;\n+ return createPendingSidebar(\n+ messageInfo,\n+ threadInfo,\n+ viewerID,\n+ getDefaultTextMessageRules().simpleMarkdownRules,\n+ );\n+}\nfunction navigateToSidebar<RouteName: MessageTooltipRouteNames>(\nroute: TooltipRoute<RouteName>,\n@@ -27,4 +52,4 @@ function navigateToSidebar<RouteName: MessageTooltipRouteNames>(\nnavigation.navigate(createNavigateToThreadAction({ threadInfo }));\n}\n-export { navigateToSidebar };\n+export { navigateToSidebar, getSidebarThreadInfo };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/utils.js", "new_path": "native/chat/utils.js", "diff": "// @flow\n-import invariant from 'invariant';\nimport * as React from 'react';\nimport { useMessageListData } from 'lib/selectors/chat-selectors';\n-import { createPendingSidebar } from 'lib/shared/thread-utils';\n-import type { ThreadInfo } from 'lib/types/thread-types';\n-import { getDefaultTextMessageRules } from '../markdown/rules.react';\nimport { useSelector } from '../redux/redux-utils';\nimport type { LayoutCoordinates, VerticalBounds } from '../types/layout-types';\nimport { useHeightMeasurer } from './chat-context';\n-import { chatMessageItemHeight } from './chat-list.react';\nimport type { ChatMessageItemWithHeight } from './message-list-container.react';\n-import type { ChatMessageInfoItemWithHeight } from './message.react';\n+import {\n+ type ChatMessageInfoItemWithHeight,\n+ messageItemHeight,\n+} from './message.react';\n+import { getSidebarThreadInfo } from './sidebar-navigation';\nimport { timestampHeight } from './timestamp.react';\n-function getSidebarThreadInfo(\n- sourceMessage: ChatMessageInfoItemWithHeight,\n- viewerID?: ?string,\n-): ThreadInfo {\n- const threadCreatedFromMessage = sourceMessage.threadCreatedFromMessage;\n- if (threadCreatedFromMessage) {\n- return threadCreatedFromMessage;\n+function chatMessageItemHeight(item: ChatMessageItemWithHeight): number {\n+ if (item.itemType === 'loader') {\n+ return 56;\n}\n-\n- invariant(viewerID, 'viewerID should be set');\n-\n- const { messageInfo, threadInfo } = sourceMessage;\n- return createPendingSidebar(\n- messageInfo,\n- threadInfo,\n- viewerID,\n- getDefaultTextMessageRules().simpleMarkdownRules,\n- );\n+ return messageItemHeight(item);\n}\nfunction useMessageTargetPosition(\n@@ -102,4 +88,8 @@ function useMessageTargetPosition(\nreturn targetDistanceFromBottom - currentDistanceFromBottom;\n}\n-export { getSidebarThreadInfo, useMessageTargetPosition };\n+export {\n+ getSidebarThreadInfo,\n+ chatMessageItemHeight,\n+ useMessageTargetPosition,\n+};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Move chatMessageItemHeight to utils Summary: We do this to avoid a require loop Test Plan: Open a thread and check if it is rendered correctly Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1756
129,191
20.07.2021 16:34:03
-7,200
4d50a2d7278a2299842a5e3cbe7838a4bdbfef71
[native] Store currentTransitionSidebarSourceID in the context Summary: We would like to store this outside the redux. The first step is to create a place to store it in the context. Test Plan: Tested with next diffs Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "ADD", "old_path": null, "new_path": "lib/types/hook-types.js", "diff": "+// @flow\n+\n+export type SetState<T> = ((T => T) | T) => void;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-context-provider.react.js", "new_path": "native/chat/chat-context-provider.react.js", "diff": "@@ -98,11 +98,18 @@ function ChatContextProvider(props: Props): React.Node {\n};\n}, [measureMessages]);\n+ const [\n+ currentTransitionSidebarSourceID,\n+ setCurrentTransitionSidebarSourceID,\n+ ] = React.useState<?string>(null);\n+\nconst contextValue = React.useMemo(\n() => ({\nregisterMeasurer,\n+ currentTransitionSidebarSourceID,\n+ setCurrentTransitionSidebarSourceID,\n}),\n- [registerMeasurer],\n+ [currentTransitionSidebarSourceID, registerMeasurer],\n);\nconst heightMeasurers = React.useMemo(\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-context.js", "new_path": "native/chat/chat-context.js", "diff": "@@ -4,6 +4,7 @@ import invariant from 'invariant';\nimport * as React from 'react';\nimport type { ChatMessageItem } from 'lib/selectors/chat-selectors';\n+import type { SetState } from 'lib/types/hook-types';\nimport type { ThreadInfo } from 'lib/types/thread-types';\nimport type { ChatMessageItemWithHeight } from './message-list-container.react';\n@@ -21,6 +22,8 @@ export type RegisteredMeasurer = {\nexport type ChatContextType = {\n+registerMeasurer: () => RegisteredMeasurer,\n+ +currentTransitionSidebarSourceID: ?string,\n+ +setCurrentTransitionSidebarSourceID: SetState<?string>,\n};\nconst ChatContext: React.Context<?ChatContextType> = React.createContext(null);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Store currentTransitionSidebarSourceID in the context Summary: We would like to store this outside the redux. The first step is to create a place to store it in the context. Test Plan: Tested with next diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1770
129,191
21.07.2021 11:52:47
-7,200
96a944eedf8a1e16e00558a786221e2c7bae480e
[native] Delete currentTransitionSidebarSourceID from redux Summary: The last step: we can now delete the state and actions. Test Plan: Check if opening a sidebar by using a tooltip works correctly including hiding the source message while the navigation is in progress. Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/navigation/default-state.js", "new_path": "native/navigation/default-state.js", "diff": "import type { StaleNavigationState } from '@react-navigation/native';\n+import type { BaseNavInfo } from 'lib/types/nav-types';\nimport { fifteenDaysEarlier, fifteenDaysLater } from 'lib/utils/date-utils';\n-import type { NavInfo } from '../types/nav-types';\nimport {\nAppRouteName,\nTabNavigatorRouteName,\n@@ -18,6 +18,8 @@ import {\nAppsRouteName,\n} from './route-names';\n+export type NavInfo = $Exact<BaseNavInfo>;\n+\nconst defaultNavigationState: StaleNavigationState = {\ntype: 'stack',\nindex: 1,\n" }, { "change_type": "MODIFY", "old_path": "native/redux/action-types.js", "new_path": "native/redux/action-types.js", "diff": "@@ -76,8 +76,4 @@ export type Action =\n| {\n+type: 'UPDATE_THREAD_LAST_NAVIGATED',\n+payload: { +threadID: string, +time: number },\n- }\n- | {\n- +type: 'SET_CURRENT_TRANSITION_SIDEBAR_SOURCE_ID',\n- +payload: ?string,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -37,7 +37,6 @@ import { reduceThreadIDsToNotifIDs } from '../push/reducer';\nimport reactotron from '../reactotron';\nimport { defaultDeviceCameraInfo } from '../types/camera';\nimport { defaultConnectivityInfo } from '../types/connectivity';\n-import { setCurrentTransitionSidebarSourceIDType } from '../types/nav-types';\nimport { defaultGlobalThemeInfo } from '../types/themes';\nimport {\ndefaultURLPrefix,\n@@ -244,14 +243,6 @@ function reducer(state: AppState = defaultState, action: Action) {\n...state,\ndeviceToken: action.payload,\n};\n- } else if (action.type === setCurrentTransitionSidebarSourceIDType) {\n- return {\n- ...state,\n- navInfo: {\n- ...state.navInfo,\n- currentTransitionSidebarSourceID: action.payload,\n- },\n- };\n} else if (action.type === updateThreadLastNavigatedActionType) {\nconst { threadID, time } = action.payload;\nif (state.messageStore.threads[threadID]) {\n" }, { "change_type": "MODIFY", "old_path": "native/redux/state-types.js", "new_path": "native/redux/state-types.js", "diff": "@@ -14,10 +14,10 @@ import type { ConnectionInfo } from 'lib/types/socket-types';\nimport type { ThreadStore } from 'lib/types/thread-types';\nimport type { CurrentUserInfo, UserStore } from 'lib/types/user-types';\n+import type { NavInfo } from '../navigation/default-state';\nimport type { NotifPermissionAlertInfo } from '../push/alerts';\nimport type { DeviceCameraInfo } from '../types/camera';\nimport type { ConnectivityInfo } from '../types/connectivity';\n-import type { NavInfo } from '../types/nav-types';\nimport type { GlobalThemeInfo } from '../types/themes';\nimport type { DimensionsInfo } from './dimensions-updater.react';\n" }, { "change_type": "DELETE", "old_path": "native/types/nav-types.js", "new_path": null, "diff": "-// @flow\n-\n-import type { BaseNavInfo } from 'lib/types/nav-types';\n-\n-export type NavInfo = {\n- ...$Exact<BaseNavInfo>,\n- +currentTransitionSidebarSourceID?: string,\n-};\n-\n-export const setCurrentTransitionSidebarSourceIDType =\n- 'SET_CURRENT_TRANSITION_SIDEBAR_SOURCE_ID';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Delete currentTransitionSidebarSourceID from redux Summary: The last step: we can now delete the state and actions. Test Plan: Check if opening a sidebar by using a tooltip works correctly including hiding the source message while the navigation is in progress. Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1772
129,187
21.07.2021 21:55:48
14,400
a42cb4a1af4baf590e9b6c850de57bcb9c28d41a
[native] Rename linkPressActive to linkModalActive Summary: Next diff will add a new, similar property to `MarkdownLinkContext` that will also block presses. Test Plan: Flow Reviewers: palys-swm, atul Subscribers: KatPo, Adrian
[ { "change_type": "MODIFY", "old_path": "native/chat/text-message.react.js", "new_path": "native/chat/text-message.react.js", "diff": "@@ -85,7 +85,7 @@ type Props = {\n// withOverlayContext\n+overlayContext: ?OverlayContextType,\n// MarkdownLinkContext\n- +linkPressActive: boolean,\n+ +linkIsBlockingPresses: boolean,\n};\nclass TextMessage extends React.PureComponent<Props> {\nmessage: ?React.ElementRef<typeof View>;\n@@ -99,7 +99,7 @@ class TextMessage extends React.PureComponent<Props> {\ntoggleFocus,\nverticalBounds,\noverlayContext,\n- linkPressActive,\n+ linkIsBlockingPresses,\ncanCreateSidebarFromMessage,\n...viewProps\n} = this.props;\n@@ -157,9 +157,9 @@ class TextMessage extends React.PureComponent<Props> {\nconst {\nmessage,\n- props: { verticalBounds, linkPressActive },\n+ props: { verticalBounds, linkIsBlockingPresses },\n} = this;\n- if (!message || !verticalBounds || linkPressActive) {\n+ if (!message || !verticalBounds || linkIsBlockingPresses) {\nreturn;\n}\n@@ -216,25 +216,26 @@ const ConnectedTextMessage: React.ComponentType<BaseProps> = React.memo<BaseProp\nfunction ConnectedTextMessage(props: BaseProps) {\nconst overlayContext = React.useContext(OverlayContext);\n- const [linkPressActive, setLinkPressActive] = React.useState(false);\n+ const [linkModalActive, setLinkModalActive] = React.useState(false);\nconst markdownLinkContext = React.useMemo(\n() => ({\n- setLinkPressActive,\n+ setLinkModalActive,\n}),\n- [setLinkPressActive],\n+ [setLinkModalActive],\n);\nconst canCreateSidebarFromMessage = useCanCreateSidebarFromMessage(\nprops.item.threadInfo,\nprops.item.messageInfo,\n);\n+ const linkIsBlockingPresses = linkModalActive;\nreturn (\n<MarkdownLinkContext.Provider value={markdownLinkContext}>\n<TextMessage\n{...props}\ncanCreateSidebarFromMessage={canCreateSidebarFromMessage}\noverlayContext={overlayContext}\n- linkPressActive={linkPressActive}\n+ linkIsBlockingPresses={linkIsBlockingPresses}\n/>\n</MarkdownLinkContext.Provider>\n);\n" }, { "change_type": "MODIFY", "old_path": "native/markdown/markdown-link-context.js", "new_path": "native/markdown/markdown-link-context.js", "diff": "import * as React from 'react';\nexport type MarkdownLinkContextType = {\n- +setLinkPressActive: boolean => void,\n+ +setLinkModalActive: boolean => void,\n};\nconst MarkdownLinkContext: React.Context<?MarkdownLinkContextType> = React.createContext<?MarkdownLinkContextType>(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Rename linkPressActive to linkModalActive Summary: Next diff will add a new, similar property to `MarkdownLinkContext` that will also block presses. Test Plan: Flow Reviewers: palys-swm, atul Reviewed By: palys-swm Subscribers: KatPo, Adrian Differential Revision: https://phabricator.ashoat.com/D1775
129,187
22.07.2021 14:26:07
14,400
0adcd13d8c97d03006405d39dd65bcee6a008dde
[lib] Refactor createPendingSidebar to improve readability Summary: This diff should be a no-op, just moving things around. Longer variable names, colocating relevant code together, etc. Test Plan: Flow, and tested in combination with following diffs Reviewers: palys-swm, atul Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "lib/shared/thread-utils.js", "new_path": "lib/shared/thread-utils.js", "diff": "@@ -358,33 +358,46 @@ function createPendingThreadItem(\n}\nfunction createPendingSidebar(\n- messageInfo: ComposableMessageInfo | RobotextMessageInfo,\n- threadInfo: ThreadInfo,\n+ sourceMessageInfo: ComposableMessageInfo | RobotextMessageInfo,\n+ parentThreadInfo: ThreadInfo,\nviewerID: string,\nmarkdownRules: ParserRules,\n): ThreadInfo {\n- const { id, username } = messageInfo.creator;\n- const { id: parentThreadID, color } = threadInfo;\n+ const { id: parentThreadID, color } = parentThreadInfo;\nconst messageTitle = getMessageTitle(\n- messageInfo,\n- threadInfo,\n+ sourceMessageInfo,\n+ parentThreadInfo,\nmarkdownRules,\n'global_viewer',\n);\nconst threadName = trimText(messageTitle, 30);\n- invariant(username, 'username should be set in createPendingSidebar');\n- const initialMemberUserInfo: GlobalAccountUserInfo = { id, username };\n- const creatorIsMember = userIsMember(threadInfo, id);\n+ const initialMembers = [];\n+ if (userIsMember(parentThreadInfo, sourceMessageInfo.creator.id)) {\n+ const {\n+ id: sourceAuthorID,\n+ username: sourceAuthorUsername,\n+ } = sourceMessageInfo.creator;\n+ invariant(\n+ sourceAuthorUsername,\n+ 'sourceAuthorUsername should be set in createPendingSidebar',\n+ );\n+ const initialMemberUserInfo: GlobalAccountUserInfo = {\n+ id: sourceAuthorID,\n+ username: sourceAuthorUsername,\n+ };\n+ initialMembers.push(initialMemberUserInfo);\n+ }\n+\nreturn createPendingThread({\nviewerID,\nthreadType: threadTypes.SIDEBAR,\n- members: creatorIsMember ? [initialMemberUserInfo] : [],\n+ members: initialMembers,\nparentThreadID,\nthreadColor: color,\nname: threadName,\n- sourceMessageID: messageInfo.id,\n+ sourceMessageID: sourceMessageInfo.id,\n});\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Refactor createPendingSidebar to improve readability Summary: This diff should be a no-op, just moving things around. Longer variable names, colocating relevant code together, etc. Test Plan: Flow, and tested in combination with following diffs Reviewers: palys-swm, atul Reviewed By: atul Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1783
129,187
22.07.2021 14:58:46
14,400
10e0f48c1849c9904cebc853be9c08675a302270
[lib] Avoid repeating logic in getThreadOtherUsers Summary: While refactoring something else I realized this logic was repeated in a couple places. Test Plan: Flow Reviewers: palys-swm, atul Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "lib/shared/thread-utils.js", "new_path": "lib/shared/thread-utils.js", "diff": "@@ -223,10 +223,7 @@ function getSingleOtherUser(\nif (!viewerID) {\nreturn undefined;\n}\n-\n- const otherMemberIDs = threadInfo.members\n- .filter(member => member.role && member.id !== viewerID)\n- .map(member => member.id);\n+ const otherMemberIDs = getThreadOtherUsers(threadInfo, viewerID);\nif (otherMemberIDs.length !== 1) {\nreturn undefined;\n}\n@@ -574,12 +571,8 @@ function robotextName(\nviewerID: ?string,\nuserInfos: UserInfos,\n): string {\n- const threadUsernames: string[] = threadInfo.members\n- .filter(threadMember => threadMember.id !== viewerID && threadMember.role)\n- .map(\n- threadMember =>\n- userInfos[threadMember.id] && userInfos[threadMember.id].username,\n- )\n+ const threadUsernames = getThreadOtherUsers(threadInfo, viewerID)\n+ .map(memberID => userInfos[memberID] && userInfos[memberID].username)\n.filter(Boolean);\nif (threadUsernames.length === 0) {\nreturn 'just you';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Avoid repeating logic in getThreadOtherUsers Summary: While refactoring something else I realized this logic was repeated in a couple places. Test Plan: Flow Reviewers: palys-swm, atul Reviewed By: atul Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1784
129,187
22.07.2021 16:50:14
14,400
81a483481e42a11ef96170e79f77806e9379030e
[native] codeVersion -> 92 Android-only release to solve notifications. (See [Notion task](https://www.notion.so/commapp/Android-fails-to-start-JS-runtime-from-notification-bb01f808f0e44201be941a6fbbc1a4a7).)
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -284,8 +284,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 91\n- versionName '0.0.91'\n+ versionCode 92\n+ versionName '0.0.92'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.91</string>\n+ <string>0.0.92</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>91</string>\n+ <string>92</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.91</string>\n+ <string>0.0.92</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>91</string>\n+ <string>92</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -280,7 +280,7 @@ const persistConfig = {\ntimeout: ((__DEV__ ? 0 : undefined): number | void),\n};\n-const codeVersion = 91;\n+const codeVersion = 92;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 92 Android-only release to solve notifications. (See [Notion task](https://www.notion.so/commapp/Android-fails-to-start-JS-runtime-from-notification-bb01f808f0e44201be941a6fbbc1a4a7).)
129,191
21.07.2021 13:41:12
-7,200
e7fd4338cb5ebf2de87def4ed6962f6edd2dfccb
[native] Create a hook which handles source message animation Summary: The hook provides message container style and handles making source message visible again. Test Plan: Tested with the next diff Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/utils.js", "new_path": "native/chat/utils.js", "diff": "// @flow\n+import invariant from 'invariant';\nimport * as React from 'react';\n+import Animated from 'react-native-reanimated';\nimport { useMessageListData } from 'lib/selectors/chat-selectors';\nimport { useSelector } from '../redux/redux-utils';\nimport type { LayoutCoordinates, VerticalBounds } from '../types/layout-types';\n-import { useHeightMeasurer } from './chat-context';\n+import type { AnimatedViewStyle } from '../types/styles';\n+import { ChatContext, useHeightMeasurer } from './chat-context';\nimport type { ChatMessageItemWithHeight } from './message-list-container.react';\nimport {\ntype ChatMessageInfoItemWithHeight,\n@@ -15,6 +18,10 @@ import {\nimport { getSidebarThreadInfo } from './sidebar-navigation';\nimport { timestampHeight } from './timestamp.react';\n+/* eslint-disable import/no-named-as-default-member */\n+const { Node, Extrapolate, interpolateNode } = Animated;\n+/* eslint-enable import/no-named-as-default-member */\n+\nfunction chatMessageItemHeight(item: ChatMessageItemWithHeight): number {\nif (item.itemType === 'loader') {\nreturn 56;\n@@ -88,4 +95,52 @@ function useMessageTargetPosition(\nreturn targetDistanceFromBottom - currentDistanceFromBottom;\n}\n-export { chatMessageItemHeight, useMessageTargetPosition };\n+function useAnimatedMessageTooltipButton(\n+ sourceMessage: ChatMessageInfoItemWithHeight,\n+ initialCoordinates: LayoutCoordinates,\n+ messageListVerticalBounds: VerticalBounds,\n+ progress: Node,\n+): { +style: AnimatedViewStyle } {\n+ const targetPosition = useMessageTargetPosition(\n+ sourceMessage,\n+ initialCoordinates,\n+ messageListVerticalBounds,\n+ );\n+\n+ const chatContext = React.useContext(ChatContext);\n+ invariant(chatContext, 'chatContext should be set');\n+ const {\n+ currentTransitionSidebarSourceID,\n+ setCurrentTransitionSidebarSourceID,\n+ } = chatContext;\n+\n+ React.useEffect(() => {\n+ return () => setCurrentTransitionSidebarSourceID(null);\n+ }, [setCurrentTransitionSidebarSourceID]);\n+\n+ const bottom = React.useMemo(\n+ () =>\n+ interpolateNode(progress, {\n+ inputRange: [0, 1],\n+ outputRange: [targetPosition, 0],\n+ extrapolate: Extrapolate.CLAMP,\n+ }),\n+ [progress, targetPosition],\n+ );\n+\n+ const messageContainerStyle = React.useMemo(() => {\n+ return {\n+ bottom: currentTransitionSidebarSourceID ? bottom : 0,\n+ };\n+ }, [bottom, currentTransitionSidebarSourceID]);\n+\n+ return {\n+ style: messageContainerStyle,\n+ };\n+}\n+\n+export {\n+ getSidebarThreadInfo,\n+ chatMessageItemHeight,\n+ useAnimatedMessageTooltipButton,\n+};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Create a hook which handles source message animation Summary: The hook provides message container style and handles making source message visible again. Test Plan: Tested with the next diff Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1773
129,191
22.07.2021 16:42:26
-7,200
f6d6eaa16156e5798abe531951f93821c72e0992
[native] Include interpolateColors in reanimated type definition Summary: We would like to use this function but we need to have types for it first. Test Plan: Flow. Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/flow-typed/npm/react-native-reanimated_v2.x.x.js", "new_path": "native/flow-typed/npm/react-native-reanimated_v2.x.x.js", "diff": "@@ -97,6 +97,15 @@ declare module 'react-native-reanimated' {\ninterpolationConfig: InterpolationConfig,\n) => Node;\n+ declare export type InterpolateColorsConfig = {\n+ +inputRange: $ReadOnlyArray<number>,\n+ +outputColorRange: $ReadOnlyArray<number | string>,\n+ };\n+ declare export type InterpolateColors = (\n+ animationValue: NodeParam,\n+ interpolationConfig: InterpolateColorsConfig\n+ ) => Node;\n+\ndeclare export type Interpolate = (\ninput: number,\ninputRange: $ReadOnlyArray<number>,\n@@ -331,6 +340,7 @@ declare module 'react-native-reanimated' {\ndeclare export var clockRunning: ClockRunning;\ndeclare export var debug: Debug;\ndeclare export var interpolateNode: InterpolateNode;\n+ declare export var interpolateColors: InterpolateColors;\ndeclare export var interpolate: Interpolate;\ndeclare export var Extrapolate: ExtrapolateModule;\ndeclare export var timing: Timing;\n@@ -384,6 +394,7 @@ declare module 'react-native-reanimated' {\n+clockRunning: ClockRunning,\n+debug: Debug,\n+interpolateNode: InterpolateNode,\n+ +interpolateColors: InterpolateColors,\n+interpolate: Interpolate,\n+Extrapolate: ExtrapolateModule,\n+timing: Timing,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Include interpolateColors in reanimated type definition Summary: We would like to use this function but we need to have types for it first. Test Plan: Flow. Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1780
129,184
22.07.2021 13:40:20
14,400
0335582e01e36ac8499255e9639215c5af442e86
[native] SQLite3 migrations Summary: Support redux `persist.js`-style migrations in for sqlite3 Test Plan: Tested on iOS simulator and device. Android testing in progress Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "diff": "@@ -13,13 +13,48 @@ using namespace sqlite_orm;\nstd::string SQLiteQueryExecutor::sqliteFilePath;\n-void SQLiteQueryExecutor::migrate() {\n- sqlite3 *conn;\n- sqlite3_open(SQLiteQueryExecutor::sqliteFilePath.c_str(), &conn);\n+bool create_drafts_table(sqlite3 *db) {\nchar *error;\nsqlite3_exec(\n- conn,\n- \"ALTER TABLE drafts RENAME COLUMN `threadID` TO `key`\",\n+ db,\n+ \"CREATE TABLE IF NOT EXISTS drafts (threadID TEXT UNIQUE PRIMARY KEY, \"\n+ \"text TEXT)\",\n+ nullptr,\n+ nullptr,\n+ &error);\n+ if (!error) {\n+ return true;\n+ }\n+\n+ std::ostringstream stringStream;\n+ stringStream << \"Error creating 'drafts' table: \" << error;\n+ Logger::log(stringStream.str());\n+\n+ sqlite3_free(error);\n+ return false;\n+}\n+\n+bool rename_threadID_to_key(sqlite3 *db) {\n+ sqlite3_stmt *key_column_stmt;\n+ sqlite3_prepare_v2(\n+ db,\n+ \"SELECT name AS col_name FROM pragma_table_xinfo ('drafts') WHERE \"\n+ \"col_name='key';\",\n+ -1,\n+ &key_column_stmt,\n+ nullptr);\n+ sqlite3_step(key_column_stmt);\n+\n+ auto num_bytes = sqlite3_column_bytes(key_column_stmt, 0);\n+ sqlite3_finalize(key_column_stmt);\n+ if (num_bytes) {\n+ return true;\n+ }\n+\n+ char *error;\n+ sqlite3_exec(\n+ db,\n+ \"ALTER TABLE drafts RENAME COLUMN `threadID` TO `key`;\",\nnullptr,\nnullptr,\n&error);\n@@ -29,8 +64,56 @@ void SQLiteQueryExecutor::migrate() {\n<< \"to key: \" << error;\nLogger::log(stringStream.str());\nsqlite3_free(error);\n+ return false;\n+ }\n+ return true;\n+}\n+\n+typedef bool (*MigrationFunction)(sqlite3 *db);\n+std::vector<std::pair<uint, MigrationFunction>> migrations{\n+ {{1, create_drafts_table}, {2, rename_threadID_to_key}}};\n+\n+void SQLiteQueryExecutor::migrate() {\n+ sqlite3 *db;\n+ sqlite3_open(SQLiteQueryExecutor::sqliteFilePath.c_str(), &db);\n+\n+ sqlite3_stmt *user_version_stmt;\n+ sqlite3_prepare_v2(\n+ db, \"PRAGMA user_version;\", -1, &user_version_stmt, nullptr);\n+ sqlite3_step(user_version_stmt);\n+\n+ int current_user_version = sqlite3_column_int(user_version_stmt, 0);\n+ sqlite3_finalize(user_version_stmt);\n+\n+ std::stringstream version_msg;\n+ version_msg << \"db version: \" << current_user_version << std::endl;\n+ Logger::log(version_msg.str());\n+\n+ for (const auto &[idx, migration] : migrations) {\n+ if (idx <= current_user_version) {\n+ continue;\n}\n- sqlite3_close(conn);\n+\n+ std::stringstream migration_msg;\n+ sqlite3_exec(db, \"BEGIN TRANSACTION;\", nullptr, nullptr, nullptr);\n+ if (!migration(db)) {\n+ migration_msg << \"migration \" << idx << \" failed.\" << std::endl;\n+ Logger::log(migration_msg.str());\n+ break;\n+ };\n+\n+ std::stringstream update_version;\n+ update_version << \"PRAGMA user_version=\" << idx << \";\";\n+ auto update_version_str = update_version.str();\n+\n+ sqlite3_exec(db, update_version_str.c_str(), nullptr, nullptr, nullptr);\n+ sqlite3_exec(db, \"END TRANSACTION;\", nullptr, nullptr, nullptr);\n+\n+ migration_msg << \"migration \" << idx << \" succeeded.\" << std::endl;\n+ Logger::log(migration_msg.str());\n+ }\n+\n+ sqlite3_close(db);\n}\nauto SQLiteQueryExecutor::getStorage() {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] SQLite3 migrations Summary: Support redux `persist.js`-style migrations in for sqlite3 Test Plan: Tested on iOS simulator and device. Android testing in progress Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1781
129,191
23.07.2021 12:11:55
-7,200
fdab623dfdb558fe2ebc46b789b787898f637877
[native] Animate message background color Summary: Interpolate colors and use the result as a background of the message. Test Plan: Navigate using tooltip to a sidebar with different thread color that its parent and check if the message is animated correctly. Reviewers: ashoat Subscribers: KatPo, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/chat/text-message-tooltip-button.react.js", "new_path": "native/chat/text-message-tooltip-button.react.js", "diff": "@@ -36,7 +36,10 @@ function TextMessageTooltipButton(props: Props): React.Node {\n}, [progress, windowWidth, initialCoordinates]);\nconst { item, verticalBounds } = props.route.params;\n- const { style: messageContainerStyle } = useAnimatedMessageTooltipButton(\n+ const {\n+ style: messageContainerStyle,\n+ threadColorOverride,\n+ } = useAnimatedMessageTooltipButton(\nitem,\ninitialCoordinates,\nverticalBounds,\n@@ -51,7 +54,11 @@ function TextMessageTooltipButton(props: Props): React.Node {\n<MessageHeader item={item} focused={true} display=\"modal\" />\n</Animated.View>\n<Animated.View style={messageContainerStyle}>\n- <InnerTextMessage item={item} onPress={navigation.goBackOnce} />\n+ <InnerTextMessage\n+ item={item}\n+ onPress={navigation.goBackOnce}\n+ threadColorOverride={threadColorOverride}\n+ />\n</Animated.View>\n</MessageListContextProvider>\n);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/utils.js", "new_path": "native/chat/utils.js", "diff": "@@ -19,7 +19,7 @@ import { getSidebarThreadInfo } from './sidebar-navigation';\nimport { timestampHeight } from './timestamp.react';\n/* eslint-disable import/no-named-as-default-member */\n-const { Node, Extrapolate, interpolateNode } = Animated;\n+const { Node, Extrapolate, interpolateNode, interpolateColors } = Animated;\n/* eslint-enable import/no-named-as-default-member */\nfunction chatMessageItemHeight(item: ChatMessageItemWithHeight): number {\n@@ -29,11 +29,14 @@ function chatMessageItemHeight(item: ChatMessageItemWithHeight): number {\nreturn messageItemHeight(item);\n}\n-function useMessageTargetPosition(\n+function useMessageTargetParameters(\nsourceMessage: ChatMessageInfoItemWithHeight,\ninitialCoordinates: LayoutCoordinates,\nmessageListVerticalBounds: VerticalBounds,\n-): number {\n+): {\n+ +position: number,\n+ +color: string,\n+} {\nconst viewerID = useSelector(\nstate => state.currentUserInfo && state.currentUserInfo.id,\n);\n@@ -92,7 +95,10 @@ function useMessageTargetPosition(\nmessageListVerticalBounds.y -\ninitialCoordinates.y +\ntimestampHeight;\n- return targetDistanceFromBottom - currentDistanceFromBottom;\n+ return {\n+ position: targetDistanceFromBottom - currentDistanceFromBottom,\n+ color: sidebarThreadInfo.color,\n+ };\n}\nfunction useAnimatedMessageTooltipButton(\n@@ -100,8 +106,11 @@ function useAnimatedMessageTooltipButton(\ninitialCoordinates: LayoutCoordinates,\nmessageListVerticalBounds: VerticalBounds,\nprogress: Node,\n-): { +style: AnimatedViewStyle } {\n- const targetPosition = useMessageTargetPosition(\n+): { +style: AnimatedViewStyle, +threadColorOverride: ?Node } {\n+ const {\n+ position: targetPosition,\n+ color: targetColor,\n+ } = useMessageTargetParameters(\nsourceMessage,\ninitialCoordinates,\nmessageListVerticalBounds,\n@@ -128,6 +137,28 @@ function useAnimatedMessageTooltipButton(\n[progress, targetPosition],\n);\n+ const threadColorOverride = React.useMemo(() => {\n+ if (\n+ sourceMessage.messageShapeType !== 'text' ||\n+ !currentTransitionSidebarSourceID\n+ ) {\n+ return null;\n+ }\n+ return interpolateColors(progress, {\n+ inputRange: [0, 1],\n+ outputColorRange: [\n+ `#${targetColor}`,\n+ `#${sourceMessage.threadInfo.color}`,\n+ ],\n+ });\n+ }, [\n+ currentTransitionSidebarSourceID,\n+ progress,\n+ sourceMessage.messageShapeType,\n+ sourceMessage.threadInfo.color,\n+ targetColor,\n+ ]);\n+\nconst messageContainerStyle = React.useMemo(() => {\nreturn {\nbottom: currentTransitionSidebarSourceID ? bottom : 0,\n@@ -136,6 +167,7 @@ function useAnimatedMessageTooltipButton(\nreturn {\nstyle: messageContainerStyle,\n+ threadColorOverride,\n};\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Animate message background color Summary: Interpolate colors and use the result as a background of the message. Test Plan: Navigate using tooltip to a sidebar with different thread color that its parent and check if the message is animated correctly. Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1790
129,184
20.07.2021 13:38:37
14,400
7d62de351b657eacf1a62526c7b647a486cc1373
[lib] Add `Raw...MessageInfo` as valid argument type to `messageContent` for each message spec Summary: In preparation for (re)using `messageContent` function for `content` column of `messages` table in sqlite Test Plan: Tested in later diffs Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "lib/shared/messages/add-members-message-spec.js", "new_path": "lib/shared/messages/add-members-message-spec.js", "diff": "@@ -32,7 +32,9 @@ export const addMembersMessageSpec: MessageSpec<\nRawAddMembersMessageInfo,\nAddMembersMessageInfo,\n> = Object.freeze({\n- messageContent(data: AddMembersMessageData): string {\n+ messageContent(\n+ data: AddMembersMessageData | RawAddMembersMessageInfo,\n+ ): string {\nreturn JSON.stringify(data.addedUserIDs);\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/change-role-message-spec.js", "new_path": "lib/shared/messages/change-role-message-spec.js", "diff": "@@ -32,7 +32,9 @@ export const changeRoleMessageSpec: MessageSpec<\nRawChangeRoleMessageInfo,\nChangeRoleMessageInfo,\n> = Object.freeze({\n- messageContent(data: ChangeRoleMessageData): string {\n+ messageContent(\n+ data: ChangeRoleMessageData | RawChangeRoleMessageInfo,\n+ ): string {\nreturn JSON.stringify({\nuserIDs: data.userIDs,\nnewRole: data.newRole,\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/change-settings-message-spec.js", "new_path": "lib/shared/messages/change-settings-message-spec.js", "diff": "@@ -33,7 +33,9 @@ export const changeSettingsMessageSpec: MessageSpec<\nRawChangeSettingsMessageInfo,\nChangeSettingsMessageInfo,\n> = Object.freeze({\n- messageContent(data: ChangeSettingsMessageData): string {\n+ messageContent(\n+ data: ChangeSettingsMessageData | RawChangeSettingsMessageInfo,\n+ ): string {\nreturn JSON.stringify({\n[data.field]: data.value,\n});\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/create-entry-message-spec.js", "new_path": "lib/shared/messages/create-entry-message-spec.js", "diff": "@@ -31,7 +31,9 @@ export const createEntryMessageSpec: MessageSpec<\nRawCreateEntryMessageInfo,\nCreateEntryMessageInfo,\n> = Object.freeze({\n- messageContent(data: CreateEntryMessageData): string {\n+ messageContent(\n+ data: CreateEntryMessageData | RawCreateEntryMessageInfo,\n+ ): string {\nreturn JSON.stringify({\nentryID: data.entryID,\ndate: data.date,\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/create-sidebar-message-spec.js", "new_path": "lib/shared/messages/create-sidebar-message-spec.js", "diff": "@@ -34,7 +34,9 @@ export const createSidebarMessageSpec: MessageSpec<\nRawCreateSidebarMessageInfo,\nCreateSidebarMessageInfo,\n> = Object.freeze({\n- messageContent(data: CreateSidebarMessageData): string {\n+ messageContent(\n+ data: CreateSidebarMessageData | RawCreateSidebarMessageInfo,\n+ ): string {\nreturn JSON.stringify({\n...data.initialThreadState,\nsourceMessageAuthorID: data.sourceMessageAuthorID,\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/create-sub-thread-message-spec.js", "new_path": "lib/shared/messages/create-sub-thread-message-spec.js", "diff": "@@ -32,7 +32,9 @@ export const createSubThreadMessageSpec: MessageSpec<\nRawCreateSubthreadMessageInfo,\nCreateSubthreadMessageInfo,\n> = Object.freeze({\n- messageContent(data: CreateSubthreadMessageData): string {\n+ messageContent(\n+ data: CreateSubthreadMessageData | RawCreateSubthreadMessageInfo,\n+ ): string {\nreturn data.childThreadID;\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/create-thread-message-spec.js", "new_path": "lib/shared/messages/create-thread-message-spec.js", "diff": "@@ -32,7 +32,9 @@ export const createThreadMessageSpec: MessageSpec<\nRawCreateThreadMessageInfo,\nCreateThreadMessageInfo,\n> = Object.freeze({\n- messageContent(data: CreateThreadMessageData): string {\n+ messageContent(\n+ data: CreateThreadMessageData | RawCreateThreadMessageInfo,\n+ ): string {\nreturn JSON.stringify(data.initialThreadState);\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/delete-entry-message-spec.js", "new_path": "lib/shared/messages/delete-entry-message-spec.js", "diff": "@@ -31,7 +31,9 @@ export const deleteEntryMessageSpec: MessageSpec<\nRawDeleteEntryMessageInfo,\nDeleteEntryMessageInfo,\n> = Object.freeze({\n- messageContent(data: DeleteEntryMessageData): string {\n+ messageContent(\n+ data: DeleteEntryMessageData | RawDeleteEntryMessageInfo,\n+ ): string {\nreturn JSON.stringify({\nentryID: data.entryID,\ndate: data.date,\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/edit-entry-message-spec.js", "new_path": "lib/shared/messages/edit-entry-message-spec.js", "diff": "@@ -31,7 +31,7 @@ export const editEntryMessageSpec: MessageSpec<\nRawEditEntryMessageInfo,\nEditEntryMessageInfo,\n> = Object.freeze({\n- messageContent(data: EditEntryMessageData): string {\n+ messageContent(data: EditEntryMessageData | RawEditEntryMessageInfo): string {\nreturn JSON.stringify({\nentryID: data.entryID,\ndate: data.date,\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/message-spec.js", "new_path": "lib/shared/messages/message-spec.js", "diff": "@@ -67,7 +67,7 @@ export type NotificationTextsParams = {\n};\nexport type MessageSpec<Data, RawInfo, Info> = {\n- +messageContent?: (data: Data) => string,\n+ +messageContent?: (data: Data | RawInfo) => string,\n+messageTitle: (param: MessageTitleParam<Info>) => string,\n+rawMessageInfoFromRow?: (\nrow: Object,\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/multimedia-message-spec.js", "new_path": "lib/shared/messages/multimedia-message-spec.js", "diff": "@@ -53,7 +53,13 @@ export const multimediaMessageSpec: MessageSpec<\nRawMediaMessageInfo | RawImagesMessageInfo,\nMediaMessageInfo | ImagesMessageInfo,\n> = Object.freeze({\n- messageContent(data: MediaMessageData | ImagesMessageData): string {\n+ messageContent(\n+ data:\n+ | MediaMessageData\n+ | ImagesMessageData\n+ | RawMediaMessageInfo\n+ | RawImagesMessageInfo,\n+ ): string {\nconst mediaIDs = data.media.map(media => parseInt(media.id, 10));\nreturn JSON.stringify(mediaIDs);\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/remove-members-message-spec.js", "new_path": "lib/shared/messages/remove-members-message-spec.js", "diff": "@@ -32,7 +32,9 @@ export const removeMembersMessageSpec: MessageSpec<\nRawRemoveMembersMessageInfo,\nRemoveMembersMessageInfo,\n> = Object.freeze({\n- messageContent(data: RemoveMembersMessageData): string {\n+ messageContent(\n+ data: RemoveMembersMessageData | RawRemoveMembersMessageInfo,\n+ ): string {\nreturn JSON.stringify(data.removedUserIDs);\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/restore-entry-message-spec.js", "new_path": "lib/shared/messages/restore-entry-message-spec.js", "diff": "@@ -31,7 +31,9 @@ export const restoreEntryMessageSpec: MessageSpec<\nRawRestoreEntryMessageInfo,\nRestoreEntryMessageInfo,\n> = Object.freeze({\n- messageContent(data: RestoreEntryMessageData): string {\n+ messageContent(\n+ data: RestoreEntryMessageData | RawRestoreEntryMessageInfo,\n+ ): string {\nreturn JSON.stringify({\nentryID: data.entryID,\ndate: data.date,\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/sidebar-source-message-spec.js", "new_path": "lib/shared/messages/sidebar-source-message-spec.js", "diff": "@@ -28,7 +28,9 @@ export const sidebarSourceMessageSpec: MessageSpec<\nRawSidebarSourceMessageInfo,\nSidebarSourceMessageInfo,\n> = Object.freeze({\n- messageContent(data: SidebarSourceMessageData): string {\n+ messageContent(\n+ data: SidebarSourceMessageData | RawSidebarSourceMessageInfo,\n+ ): string {\nconst sourceMessageID = data.sourceMessage?.id;\ninvariant(sourceMessageID, 'Source message id should be set');\nreturn JSON.stringify({\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/text-message-spec.js", "new_path": "lib/shared/messages/text-message-spec.js", "diff": "@@ -68,7 +68,7 @@ export const textMessageSpec: MessageSpec<\nRawTextMessageInfo,\nTextMessageInfo,\n> = Object.freeze({\n- messageContent(data: TextMessageData): string {\n+ messageContent(data: TextMessageData | RawTextMessageInfo): string {\nreturn data.text;\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/update-relationship-message-spec.js", "new_path": "lib/shared/messages/update-relationship-message-spec.js", "diff": "@@ -34,7 +34,9 @@ export const updateRelationshipMessageSpec: MessageSpec<\nRawUpdateRelationshipMessageInfo,\nUpdateRelationshipMessageInfo,\n> = Object.freeze({\n- messageContent(data: UpdateRelationshipMessageData): string {\n+ messageContent(\n+ data: UpdateRelationshipMessageData | RawUpdateRelationshipMessageInfo,\n+ ): string {\nreturn JSON.stringify({\noperation: data.operation,\ntargetID: data.targetID,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Add `Raw...MessageInfo` as valid argument type to `messageContent` for each message spec Summary: In preparation for (re)using `messageContent` function for `content` column of `messages` table in sqlite Test Plan: Tested in later diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian Differential Revision: https://phabricator.ashoat.com/D1766
129,184
23.07.2021 14:28:39
14,400
98132e9cf3f75d92de0bce27ad95840ca98fcad9
[native] Add `messages` table to sqlite Summary: Add `messages` table to sqlite based on the mysql `messages` table (+future_type column) Test Plan: Table created as expected: Reviewers: ashoat Subscribers: KatPo, palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "diff": "@@ -18,7 +18,7 @@ bool create_drafts_table(sqlite3 *db) {\nsqlite3_exec(\ndb,\n\"CREATE TABLE IF NOT EXISTS drafts (threadID TEXT UNIQUE PRIMARY KEY, \"\n- \"text TEXT)\",\n+ \"text TEXT);\",\nnullptr,\nnullptr,\n&error);\n@@ -69,9 +69,39 @@ bool rename_threadID_to_key(sqlite3 *db) {\nreturn true;\n}\n+bool create_messages_table(sqlite3 *db) {\n+ char *error;\n+ sqlite3_exec(\n+ db,\n+ \"CREATE TABLE IF NOT EXISTS messages ( \"\n+ \"id INTEGER UNIQUE PRIMARY KEY NOT NULL, \"\n+ \"thread INTEGER NOT NULL, \"\n+ \"user INTEGER NOT NULL, \"\n+ \"type INTEGER NOT NULL, \"\n+ \"future_type INTEGER, \"\n+ \"content TEXT, \"\n+ \"time INTEGER NOT NULL, \"\n+ \"creation TEXT);\",\n+ nullptr,\n+ nullptr,\n+ &error);\n+ if (!error) {\n+ return true;\n+ }\n+\n+ std::ostringstream stringStream;\n+ stringStream << \"Error creating 'messages' table: \" << error;\n+ Logger::log(stringStream.str());\n+\n+ sqlite3_free(error);\n+ return false;\n+}\n+\ntypedef bool (*MigrationFunction)(sqlite3 *db);\nstd::vector<std::pair<uint, MigrationFunction>> migrations{\n- {{1, create_drafts_table}, {2, rename_threadID_to_key}}};\n+ {{1, create_drafts_table},\n+ {2, rename_threadID_to_key},\n+ {3, create_messages_table}}};\nvoid SQLiteQueryExecutor::migrate() {\nsqlite3 *db;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add `messages` table to sqlite Summary: Add `messages` table to sqlite based on the mysql `messages` table (+future_type column) Test Plan: Table created as expected: https://blob.sh/atul/497f.png Reviewers: ashoat Reviewed By: ashoat Subscribers: KatPo, palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1791
129,187
27.07.2021 01:35:30
14,400
c57f0b6e4ac2504a222492d69ca71949bd1986dc
[native] codeVersion -> 93 Bumping version, but this isn't the real 93. See the v0.0.93 git tag for the real deal (Non-public release to test Hermes, REA2, swipe-to-create-sidebar, etc.)
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -284,8 +284,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 92\n- versionName '0.0.92'\n+ versionCode 93\n+ versionName '0.0.93'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.92</string>\n+ <string>0.0.93</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>92</string>\n+ <string>93</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.92</string>\n+ <string>0.0.93</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>92</string>\n+ <string>93</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -280,7 +280,7 @@ const persistConfig = {\ntimeout: ((__DEV__ ? 0 : undefined): number | void),\n};\n-const codeVersion = 92;\n+const codeVersion = 93;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 93 Bumping version, but this isn't the real 93. See the v0.0.93 git tag for the real deal (Non-public release to test Hermes, REA2, swipe-to-create-sidebar, etc.)
129,187
26.07.2021 20:37:04
14,400
c7081be8fa10e5e701af3174f86f208987801aa5
[native] Avoid hardcoding offset for delivery icon in SwipeableMessage Summary: I realized it was possible to avoid this by changing the structure a little bit. Test Plan: Make sure the animation looks exactly the same before and after Reviewers: palys-swm, atul Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -90,20 +90,23 @@ class ComposedMessage extends React.PureComponent<Props> {\n);\n}\n- const fullMessageBoxStyle = [styles.messageBox, messageBoxStyle];\nlet messageBox;\nif (canSwipe) {\nmessageBox = (\n+ <View style={styles.messageBox}>\n<SwipeableMessage\nonSwipeableWillOpen={this.reply}\nisViewer={isViewer}\n- messageBoxStyle={fullMessageBoxStyle}\n+ messageBoxStyle={messageBoxStyle}\n>\n{children}\n</SwipeableMessage>\n+ </View>\n);\n} else {\n- messageBox = <View style={fullMessageBoxStyle}>{children}</View>;\n+ messageBox = (\n+ <View style={[styles.messageBox, messageBoxStyle]}>{children}</View>\n+ );\n}\nlet inlineSidebar = null;\nif (item.threadCreatedFromMessage) {\n" }, { "change_type": "MODIFY", "old_path": "native/chat/swipeable-message.react.js", "new_path": "native/chat/swipeable-message.react.js", "diff": "@@ -90,7 +90,7 @@ function SwipeableMessage(props: Props): React.Node {\nconst translateReplyIcon = interpolate(\ntranslateX.value,\nisViewer ? [-1 * threshold, 0] : [0, threshold],\n- isViewer ? [-23, -23 + threshold] : [0 - threshold, 0],\n+ isViewer ? [0, threshold] : [0 - threshold, 0],\nExtrapolate.CLAMP,\n);\nconst replyIconOpacity = interpolate(\n@@ -148,6 +148,8 @@ const unboundStyles = {\nicon: {\njustifyContent: 'center',\nposition: 'absolute',\n+ top: 0,\n+ bottom: 0,\n},\niconBackground: {\nalignItems: 'center',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Avoid hardcoding offset for delivery icon in SwipeableMessage Summary: I realized it was possible to avoid this by changing the structure a little bit. Test Plan: Make sure the animation looks exactly the same before and after Reviewers: palys-swm, atul Reviewed By: palys-swm Subscribers: Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1798
129,187
26.07.2021 21:14:41
14,400
6f4a639b02535f5d46abc20581aefc386ce84c10
[native] Convert composedMessageMaxWidthSelector to Hook Test Plan: Flow, make sure everything still looks right Reviewers: palys-swm, atul Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-item-height-measurer.react.js", "new_path": "native/chat/chat-item-height-measurer.react.js", "diff": "@@ -9,10 +9,9 @@ import { messageTypes, type MessageType } from 'lib/types/message-types';\nimport NodeHeightMeasurer from '../components/node-height-measurer.react';\nimport { InputStateContext } from '../input/input-state';\n-import { useSelector } from '../redux/redux-utils';\nimport type { MeasurementTask } from './chat-context-provider.react';\nimport { chatMessageItemKey } from './chat-list.react';\n-import { composedMessageMaxWidthSelector } from './composed-message-width';\n+import { useComposedMessageMaxWidth } from './composed-message-width';\nimport { dummyNodeForRobotextMessageHeightMeasurement } from './inner-robotext-message.react';\nimport { dummyNodeForTextMessageHeightMeasurement } from './inner-text-message.react';\nimport { MessageListContextProvider } from './message-list-types';\n@@ -50,7 +49,7 @@ const heightMeasurerDummy = (item: ChatMessageItem) => {\n};\nfunction ChatItemHeightMeasurer(props: Props) {\n- const composedMessageMaxWidth = useSelector(composedMessageMaxWidthSelector);\n+ const composedMessageMaxWidth = useComposedMessageMaxWidth();\nconst inputState = React.useContext(InputStateContext);\nconst inputStatePendingUploads = inputState?.pendingUploads;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/composed-message-width.js", "new_path": "native/chat/composed-message-width.js", "diff": "// @flow\n-import { createSelector } from 'reselect';\n+import { useSelector } from '../redux/redux-utils';\n-import type { DimensionsInfo } from '../redux/dimensions-updater.react';\n-import type { AppState } from '../redux/state-types';\n+function useMessageListScreenWidth(): number {\n+ return useSelector(state => {\n+ const { dimensions } = state;\n+ return dimensions.rotated ? dimensions.height : dimensions.width;\n+ });\n+}\n// Keep sorta synced with styles.alignment/styles.messageBox in ComposedMessage\n-const composedMessageMaxWidthSelector: (\n- state: AppState,\n-) => number = createSelector(\n- (state: AppState) => state.dimensions,\n- (dimensionsInfo: DimensionsInfo): number => {\n- const windowWidth = dimensionsInfo.rotated\n- ? dimensionsInfo.height\n- : dimensionsInfo.width;\n- return (windowWidth - 24) * 0.8;\n- },\n-);\n+function useComposedMessageMaxWidth(): number {\n+ const messageListScreenWidth = useMessageListScreenWidth();\n+ return (messageListScreenWidth - 24) * 0.8;\n+}\n-export { composedMessageMaxWidthSelector };\n+export { useMessageListScreenWidth, useComposedMessageMaxWidth };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -9,9 +9,8 @@ import { createMessageReply } from 'lib/shared/message-utils';\nimport { assertComposableMessageType } from 'lib/types/message-types';\nimport { type InputState, InputStateContext } from '../input/input-state';\n-import { useSelector } from '../redux/redux-utils';\nimport { type Colors, useColors } from '../themes/colors';\n-import { composedMessageMaxWidthSelector } from './composed-message-width';\n+import { useComposedMessageMaxWidth } from './composed-message-width';\nimport { FailedSend } from './failed-send.react';\nimport {\nInlineSidebar,\n@@ -178,9 +177,7 @@ const styles = StyleSheet.create({\nconst ConnectedComposedMessage: React.ComponentType<BaseProps> = React.memo<BaseProps>(\nfunction ConnectedComposedMessage(props: BaseProps) {\n- const composedMessageMaxWidth = useSelector(\n- composedMessageMaxWidthSelector,\n- );\n+ const composedMessageMaxWidth = useComposedMessageMaxWidth();\nconst colors = useColors();\nconst inputState = React.useContext(InputStateContext);\nreturn (\n" }, { "change_type": "MODIFY", "old_path": "native/chat/inner-text-message.react.js", "new_path": "native/chat/inner-text-message.react.js", "diff": "@@ -11,7 +11,7 @@ import GestureTouchableOpacity from '../components/gesture-touchable-opacity.rea\nimport Markdown from '../markdown/markdown.react';\nimport { useSelector } from '../redux/redux-utils';\nimport { useColors, colors } from '../themes/colors';\n-import { composedMessageMaxWidthSelector } from './composed-message-width';\n+import { useComposedMessageMaxWidth } from './composed-message-width';\nimport { MessageListContext } from './message-list-types';\nimport {\nallCorners,\n@@ -42,7 +42,7 @@ type DummyTextNodeProps = {\n};\nfunction DummyTextNode(props: DummyTextNodeProps): React.Node {\nconst { children, style, ...rest } = props;\n- const maxWidth = useSelector(state => composedMessageMaxWidthSelector(state));\n+ const maxWidth = useComposedMessageMaxWidth();\nconst viewStyle = [props.style, styles.dummyMessage, { maxWidth }];\nconst rules = useTextMessageMarkdownRules(false);\nreturn (\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Convert composedMessageMaxWidthSelector to Hook Test Plan: Flow, make sure everything still looks right Reviewers: palys-swm, atul Reviewed By: palys-swm Subscribers: Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1801
129,187
26.07.2021 21:19:57
14,400
9bd07b8694815549fe076ce3a63a00ebd38a7943
[native] Set width of swipeSnake in SwipeableMessage to messageListScreenWidth Summary: We want it to be at least as wide as the screen Test Plan: Make sure I can't pull the snake off screen Reviewers: palys-swm, atul Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/swipeable-message.react.js", "new_path": "native/chat/swipeable-message.react.js", "diff": "@@ -20,6 +20,7 @@ import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';\nimport { useColors, useStyles } from '../themes/colors';\nimport type { ViewStyle } from '../types/styles';\nimport { dividePastDistance } from '../utils/animation-utils';\n+import { useMessageListScreenWidth } from './composed-message-width';\nconst threshold = 40;\n@@ -122,9 +123,10 @@ function SwipeableMessage(props: Props): React.Node {\n);\nconst iconAlign = isViewer ? styles.alignStart : styles.alignEnd;\n+ const screenWidth = useMessageListScreenWidth();\nconst swipeSnakeStyle = React.useMemo(() => {\n- return [styles.swipeSnake, iconAlign];\n- }, [styles.swipeSnake, iconAlign]);\n+ return [styles.swipeSnake, iconAlign, { width: screenWidth }];\n+ }, [styles.swipeSnake, iconAlign, screenWidth]);\nconst { messageBoxStyle, children } = props;\nconst colors = useColors();\n@@ -179,7 +181,6 @@ const unboundStyles = {\nborderRadius: 25,\nheight: 30,\njustifyContent: 'center',\n- width: 500,\nmaxHeight: 50,\n},\nleft0: {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Set width of swipeSnake in SwipeableMessage to messageListScreenWidth Summary: We want it to be at least as wide as the screen Test Plan: Make sure I can't pull the snake off screen Reviewers: palys-swm, atul Reviewed By: palys-swm Subscribers: Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1802
129,187
26.07.2021 21:30:04
14,400
64769527b4ab5d0fa9a17355b863a9fee78f63f2
[native] Use threadColor for SwipeableMessage animation Test Plan: Test with different thread colors Reviewers: palys-swm, atul Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -97,6 +97,7 @@ class ComposedMessage extends React.PureComponent<Props> {\nonSwipeableWillOpen={this.reply}\nisViewer={isViewer}\nmessageBoxStyle={messageBoxStyle}\n+ threadColor={item.threadInfo.color}\n>\n{children}\n</SwipeableMessage>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/swipeable-message.react.js", "new_path": "native/chat/swipeable-message.react.js", "diff": "@@ -17,7 +17,9 @@ import Animated, {\n} from 'react-native-reanimated';\nimport FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';\n-import { useColors, useStyles } from '../themes/colors';\n+import { colorIsDark } from 'lib/shared/thread-utils';\n+\n+import { colors } from '../themes/colors';\nimport type { ViewStyle } from '../types/styles';\nimport { dividePastDistance } from '../utils/animation-utils';\nimport { useMessageListScreenWidth } from './composed-message-width';\n@@ -41,6 +43,7 @@ type Props = {\n+onSwipeableWillOpen: () => void,\n+isViewer: boolean,\n+messageBoxStyle: ViewStyle,\n+ +threadColor: string,\n+children: React.Node,\n};\nfunction SwipeableMessage(props: Props): React.Node {\n@@ -86,12 +89,10 @@ function SwipeableMessage(props: Props): React.Node {\n[isViewer, onSwipeableWillOpen],\n);\n- const styles = useStyles(unboundStyles);\n-\nconst animationPosition = isViewer ? styles.right0 : styles.left0;\nconst animationContainerStyle = React.useMemo(() => {\nreturn [styles.animationContainer, animationPosition];\n- }, [styles.animationContainer, animationPosition]);\n+ }, [animationPosition]);\nconst transformSwipeSnakeStyle = useAnimatedStyle(() => {\nconst opacity = interpolate(\n@@ -113,7 +114,7 @@ function SwipeableMessage(props: Props): React.Node {\nconst iconPosition = isViewer ? styles.left0 : styles.right0;\nconst swipeSnakeContainerStyle = React.useMemo(() => {\nreturn [styles.swipeSnakeContainer, transformSwipeSnakeStyle, iconPosition];\n- }, [styles.swipeSnakeContainer, transformSwipeSnakeStyle, iconPosition]);\n+ }, [transformSwipeSnakeStyle, iconPosition]);\nconst transformMessageBoxStyle = useAnimatedStyle(\n() => ({\n@@ -124,12 +125,23 @@ function SwipeableMessage(props: Props): React.Node {\nconst iconAlign = isViewer ? styles.alignStart : styles.alignEnd;\nconst screenWidth = useMessageListScreenWidth();\n+ const { threadColor } = props;\nconst swipeSnakeStyle = React.useMemo(() => {\n- return [styles.swipeSnake, iconAlign, { width: screenWidth }];\n- }, [styles.swipeSnake, iconAlign, screenWidth]);\n+ return [\n+ styles.swipeSnake,\n+ iconAlign,\n+ {\n+ width: screenWidth,\n+ backgroundColor: `#${threadColor}`,\n+ },\n+ ];\n+ }, [iconAlign, screenWidth, threadColor]);\n+\n+ const iconColor = colorIsDark(threadColor)\n+ ? colors.dark.listForegroundLabel\n+ : colors.light.listForegroundLabel;\nconst { messageBoxStyle, children } = props;\n- const colors = useColors();\nconst reactNavGestureHandlerRef = React.useContext(GestureHandlerRefContext);\nconst waitFor = reactNavGestureHandlerRef ?? undefined;\nreturn (\n@@ -137,11 +149,7 @@ function SwipeableMessage(props: Props): React.Node {\n<View style={animationContainerStyle}>\n<Animated.View style={swipeSnakeContainerStyle}>\n<View style={swipeSnakeStyle}>\n- <FontAwesomeIcon\n- name=\"reply\"\n- color={colors.blockQuoteBorder}\n- size={16}\n- />\n+ <FontAwesomeIcon name=\"reply\" color={iconColor} size={16} />\n</View>\n</Animated.View>\n</View>\n@@ -161,7 +169,7 @@ function SwipeableMessage(props: Props): React.Node {\n);\n}\n-const unboundStyles = {\n+const styles = {\nswipeSnakeContainer: {\nmarginHorizontal: 20,\njustifyContent: 'center',\n@@ -177,7 +185,6 @@ const unboundStyles = {\nswipeSnake: {\npaddingHorizontal: 15,\nflex: 1,\n- backgroundColor: 'listChatBubble',\nborderRadius: 25,\nheight: 30,\njustifyContent: 'center',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use threadColor for SwipeableMessage animation Test Plan: Test with different thread colors Reviewers: palys-swm, atul Reviewed By: palys-swm Subscribers: Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1803
129,187
27.07.2021 00:34:06
14,400
1b2d85cce829b42444db5a3920414e4c40c7b9c5
[native] Introduce second SwipeSnake for sidebar in SwipeableMessage Summary: Woohoo! Test Plan: Test the interaction extensively on a real phone Reviewers: palys-swm, atul Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/swipeable-message.react.js", "new_path": "native/chat/swipeable-message.react.js", "diff": "@@ -18,15 +18,16 @@ import Animated, {\n} from 'react-native-reanimated';\nimport type { IconProps } from 'react-native-vector-icons';\nimport FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';\n-\n-import { colorIsDark } from 'lib/shared/thread-utils';\n+import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';\n+import tinycolor from 'tinycolor2';\nimport { colors } from '../themes/colors';\nimport type { ViewStyle } from '../types/styles';\nimport { dividePastDistance } from '../utils/animation-utils';\nimport { useMessageListScreenWidth } from './composed-message-width';\n-const threshold = 40;\n+const replyThreshold = 40;\n+const sidebarThreshold = 120;\nfunction makeSpringConfig(velocity: number) {\n'worklet';\n@@ -41,32 +42,56 @@ function makeSpringConfig(velocity: number) {\n};\n}\n+function interpolateOpacityForViewerReplySnake(translateX: number) {\n+ 'worklet';\n+ return interpolate(translateX, [-20, -5], [1, 0], Extrapolate.CLAMP);\n+}\n+function interpolateOpacityForNonViewerReplySnake(translateX: number) {\n+ 'worklet';\n+ return interpolate(translateX, [5, 20], [0, 1], Extrapolate.CLAMP);\n+}\n+function interpolateTranslateXForViewerSidebarSnake(translateX: number) {\n+ 'worklet';\n+ return interpolate(translateX, [-130, -120, -60, 0], [-130, -120, -5, 20]);\n+}\n+function interpolateTranslateXForNonViewerSidebarSnake(translateX: number) {\n+ 'worklet';\n+ return interpolate(translateX, [0, 80, 120, 130], [0, 30, 120, 130]);\n+}\n+\ntype SwipeSnakeProps<IconGlyphs: string> = {\n+isViewer: boolean,\n+translateX: SharedValue<number>,\n+color: string,\n+children: React.Element<React.ComponentType<IconProps<IconGlyphs>>>,\n+ +opacityInterpolator?: number => number, // must be worklet\n+ +translateXInterpolator?: number => number, // must be worklet\n};\nfunction SwipeSnake<IconGlyphs: string>(\nprops: SwipeSnakeProps<IconGlyphs>,\n): React.Node {\n- const { translateX, isViewer } = props;\n+ const {\n+ translateX,\n+ isViewer,\n+ opacityInterpolator,\n+ translateXInterpolator,\n+ } = props;\nconst transformStyle = useAnimatedStyle(() => {\n- const opacity = interpolate(\n- translateX.value,\n- isViewer ? [-20, -5] : [5, 20],\n- isViewer ? [1, 0] : [0, 1],\n- Extrapolate.CLAMP,\n- );\n+ const opacity = opacityInterpolator\n+ ? opacityInterpolator(translateX.value)\n+ : undefined;\n+ const translate = translateXInterpolator\n+ ? translateXInterpolator(translateX.value)\n+ : translateX.value;\nreturn {\ntransform: [\n{\n- translateX: translateX.value,\n+ translateX: translate,\n},\n],\nopacity,\n};\n- }, [isViewer]);\n+ }, [isViewer, translateXInterpolator, opacityInterpolator]);\nconst animationPosition = isViewer ? styles.right0 : styles.left0;\nconst animationContainerStyle = React.useMemo(() => {\n@@ -87,13 +112,13 @@ function SwipeSnake<IconGlyphs: string>(\niconAlign,\n{\nwidth: screenWidth,\n- backgroundColor: `#${color}`,\n+ backgroundColor: color,\n},\n];\n}, [iconAlign, screenWidth, color]);\nconst { children } = props;\n- const iconColor = colorIsDark(color)\n+ const iconColor = tinycolor(color).isDark()\n? colors.dark.listForegroundLabel\n: colors.light.listForegroundLabel;\nconst coloredIcon = React.useMemo(\n@@ -142,18 +167,26 @@ function SwipeableMessage(props: Props): React.Node {\n: Math.max(translationX, 0);\ntranslateX.value = dividePastDistance(\nbaseActiveTranslation,\n- threshold,\n+ replyThreshold,\n2,\n);\n- const pastThreshold = Math.abs(translateX.value) >= threshold;\n- if (pastThreshold && !ctx.prevPastThreshold) {\n+ const absValue = Math.abs(translateX.value);\n+ const pastReplyThreshold = absValue >= replyThreshold;\n+ if (pastReplyThreshold && !ctx.prevPastReplyThreshold) {\nrunOnJS(onPassThreshold)();\n}\n- ctx.prevPastThreshold = pastThreshold;\n+ ctx.prevPastReplyThreshold = pastReplyThreshold;\n+\n+ const pastSidebarThreshold = absValue >= sidebarThreshold;\n+ if (pastSidebarThreshold && !ctx.prevPastSidebarThreshold) {\n+ runOnJS(onPassThreshold)();\n+ }\n+ ctx.prevPastSidebarThreshold = pastSidebarThreshold;\n},\nonEnd: event => {\n- if (Math.abs(translateX.value) >= threshold) {\n+ const absValue = Math.abs(translateX.value);\n+ if (absValue >= replyThreshold) {\nrunOnJS(onSwipeableWillOpen)();\n}\n@@ -170,18 +203,41 @@ function SwipeableMessage(props: Props): React.Node {\n[],\n);\n- const { messageBoxStyle, threadColor, children } = props;\n+ const { messageBoxStyle, children } = props;\nconst reactNavGestureHandlerRef = React.useContext(GestureHandlerRefContext);\nconst waitFor = reactNavGestureHandlerRef ?? undefined;\n+\n+ const threadColor = `#${props.threadColor}`;\n+ const tinyThreadColor = tinycolor(threadColor);\n+ const darkerThreadColor = tinyThreadColor\n+ .darken(tinyThreadColor.isDark() ? 10 : 20)\n+ .toString();\n+\n+ const replySnakeOpacityInterpolator = isViewer\n+ ? interpolateOpacityForViewerReplySnake\n+ : interpolateOpacityForNonViewerReplySnake;\n+ const sidebarSnakeTranslateXInterpolator = isViewer\n+ ? interpolateTranslateXForViewerSidebarSnake\n+ : interpolateTranslateXForNonViewerSidebarSnake;\n+\nreturn (\n<>\n<SwipeSnake\nisViewer={isViewer}\ntranslateX={translateX}\ncolor={threadColor}\n+ opacityInterpolator={replySnakeOpacityInterpolator}\n>\n<FontAwesomeIcon name=\"reply\" size={16} />\n</SwipeSnake>\n+ <SwipeSnake\n+ isViewer={isViewer}\n+ translateX={translateX}\n+ color={darkerThreadColor}\n+ translateXInterpolator={sidebarSnakeTranslateXInterpolator}\n+ >\n+ <MaterialCommunityIcon name=\"comment-text\" size={16} />\n+ </SwipeSnake>\n<PanGestureHandler\nmaxPointers={1}\nminDist={4}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Introduce second SwipeSnake for sidebar in SwipeableMessage Summary: Woohoo! Test Plan: Test the interaction extensively on a real phone Reviewers: palys-swm, atul Reviewed By: palys-swm Subscribers: Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1805
129,187
27.07.2021 01:11:45
14,400
73041f3d8ad3f865357aa74a29e8708998227f54
[native] Navigate to sidebar from SwipeableMessage Summary: Actually performs the action when the user swipes Test Plan: Test the threshold on a real phone Reviewers: palys-swm, atul Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -19,6 +19,7 @@ import {\n} from './inline-sidebar.react';\nimport { MessageHeader } from './message-header.react';\nimport type { ChatMessageInfoItemWithHeight } from './message.react';\n+import { useNavigateToSidebar } from './sidebar-navigation';\nimport SwipeableMessage from './swipeable-message.react';\nconst clusterEndHeight = 7;\n@@ -38,6 +39,7 @@ type Props = {\n+colors: Colors,\n// withInputState\n+inputState: ?InputState,\n+ +navigateToSidebar: () => void,\n};\nclass ComposedMessage extends React.PureComponent<Props> {\nrender() {\n@@ -51,6 +53,7 @@ class ComposedMessage extends React.PureComponent<Props> {\ncomposedMessageMaxWidth,\ncolors,\ninputState,\n+ navigateToSidebar,\n...viewProps\n} = this.props;\nconst { id, creator } = item.messageInfo;\n@@ -94,7 +97,8 @@ class ComposedMessage extends React.PureComponent<Props> {\nmessageBox = (\n<View style={styles.messageBox}>\n<SwipeableMessage\n- onSwipeableWillOpen={this.reply}\n+ triggerReply={this.reply}\n+ triggerSidebar={navigateToSidebar}\nisViewer={isViewer}\nmessageBoxStyle={messageBoxStyle}\nthreadColor={item.threadInfo.color}\n@@ -181,12 +185,14 @@ const ConnectedComposedMessage: React.ComponentType<BaseProps> = React.memo<Base\nconst composedMessageMaxWidth = useComposedMessageMaxWidth();\nconst colors = useColors();\nconst inputState = React.useContext(InputStateContext);\n+ const navigateToSidebar = useNavigateToSidebar(props.item);\nreturn (\n<ComposedMessage\n{...props}\ncomposedMessageMaxWidth={composedMessageMaxWidth}\ncolors={colors}\ninputState={inputState}\n+ navigateToSidebar={navigateToSidebar}\n/>\n);\n},\n" }, { "change_type": "MODIFY", "old_path": "native/chat/sidebar-navigation.js", "new_path": "native/chat/sidebar-navigation.js", "diff": "// @flow\nimport invariant from 'invariant';\n+import * as React from 'react';\nimport { createPendingSidebar } from 'lib/shared/thread-utils';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n@@ -11,8 +12,12 @@ import { getDefaultTextMessageRules } from '../markdown/rules.react';\nimport type { AppNavigationProp } from '../navigation/app-navigator.react';\nimport type { MessageTooltipRouteNames } from '../navigation/route-names';\nimport type { TooltipRoute } from '../navigation/tooltip.react';\n+import { useSelector } from '../redux/redux-utils';\nimport type { ChatContextType } from './chat-context';\n-import { createNavigateToThreadAction } from './message-list-types';\n+import {\n+ createNavigateToThreadAction,\n+ useNavigateToThread,\n+} from './message-list-types';\nimport type { ChatMessageInfoItemWithHeight } from './message.react';\nfunction getSidebarThreadInfo(\n@@ -52,4 +57,18 @@ function navigateToSidebar<RouteName: MessageTooltipRouteNames>(\nnavigation.navigate(createNavigateToThreadAction({ threadInfo }));\n}\n-export { navigateToSidebar, getSidebarThreadInfo };\n+function useNavigateToSidebar(item: ChatMessageInfoItemWithHeight): () => void {\n+ const viewerID = useSelector(\n+ state => state.currentUserInfo && state.currentUserInfo.id,\n+ );\n+ const threadInfo = React.useMemo(() => getSidebarThreadInfo(item, viewerID), [\n+ item,\n+ viewerID,\n+ ]);\n+ const navigateToThread = useNavigateToThread();\n+ return React.useCallback(() => {\n+ navigateToThread({ threadInfo });\n+ }, [navigateToThread, threadInfo]);\n+}\n+\n+export { navigateToSidebar, getSidebarThreadInfo, useNavigateToSidebar };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/swipeable-message.react.js", "new_path": "native/chat/swipeable-message.react.js", "diff": "@@ -139,14 +139,15 @@ function SwipeSnake<IconGlyphs: string>(\n}\ntype Props = {\n- +onSwipeableWillOpen: () => void,\n+ +triggerReply: () => void,\n+ +triggerSidebar: () => void,\n+isViewer: boolean,\n+messageBoxStyle: ViewStyle,\n+threadColor: string,\n+children: React.Node,\n};\nfunction SwipeableMessage(props: Props): React.Node {\n- const { isViewer, onSwipeableWillOpen } = props;\n+ const { isViewer, triggerReply, triggerSidebar } = props;\nconst onPassThreshold = React.useCallback(() => {\nif (Platform.OS === 'ios') {\nTapticFeedback.impact();\n@@ -186,14 +187,16 @@ function SwipeableMessage(props: Props): React.Node {\n},\nonEnd: event => {\nconst absValue = Math.abs(translateX.value);\n- if (absValue >= replyThreshold) {\n- runOnJS(onSwipeableWillOpen)();\n+ if (absValue >= sidebarThreshold) {\n+ runOnJS(triggerSidebar)();\n+ } else if (absValue >= replyThreshold) {\n+ runOnJS(triggerReply)();\n}\ntranslateX.value = withSpring(0, makeSpringConfig(event.velocityX));\n},\n},\n- [isViewer, onSwipeableWillOpen],\n+ [isViewer, triggerReply, triggerSidebar],\n);\nconst transformMessageBoxStyle = useAnimatedStyle(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Navigate to sidebar from SwipeableMessage Summary: Actually performs the action when the user swipes Test Plan: Test the threshold on a real phone Reviewers: palys-swm, atul Reviewed By: palys-swm Subscribers: Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1806
129,184
27.07.2021 09:55:04
14,400
6bc65e13cca4f4679241f26829cdb63fd80564d6
[native] Introduce `Message.h` Summary: na Test Plan: na, will know if something is wrong after subsequent diffs Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "ADD", "old_path": null, "new_path": "native/cpp/CommonCpp/DatabaseManagers/entities/Message.h", "diff": "+#pragma once\n+\n+#include <string>\n+\n+namespace comm {\n+\n+struct Message {\n+ int id;\n+ int thread;\n+ int user;\n+ int type;\n+ int future_type;\n+ std::string content;\n+ int time;\n+ std::string creation;\n+};\n+\n+} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm.xcodeproj/project.pbxproj", "new_path": "native/ios/Comm.xcodeproj/project.pbxproj", "diff": "7FCEA2DC2444010B004017B1 /* Comm-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"Comm-Bridging-Header.h\"; sourceTree = \"<group>\"; };\n7FCFD8BD1E81B8DF00629B0E /* Comm.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Comm.entitlements; path = Comm/Comm.entitlements; sourceTree = \"<group>\"; };\n994BEBDD4E4959F69CEA0BC3 /* libPods-Comm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-Comm.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n+ B70FBC1226B047050040F480 /* Message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Message.h; sourceTree = \"<group>\"; };\nB71AFF1E265EDD8600B22352 /* IBMPlexSans-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = \"IBMPlexSans-Medium.ttf\"; path = \"Resources/IBMPlexSans-Medium.ttf\"; sourceTree = \"<group>\"; };\nB723460626979250009A0709 /* swmansion.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = swmansion.ttf; path = Resources/swmansion.ttf; sourceTree = \"<group>\"; };\nC562A7004903539402D988CE /* Pods-Comm.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-Comm.release.xcconfig\"; path = \"Target Support Files/Pods-Comm/Pods-Comm.release.xcconfig\"; sourceTree = \"<group>\"; };\nisa = PBXGroup;\nchildren = (\n71BE84452636A944002849D2 /* Draft.h */,\n+ B70FBC1226B047050040F480 /* Message.h */,\n);\npath = entities;\nsourceTree = \"<group>\";\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Introduce `Message.h` Summary: na Test Plan: na, will know if something is wrong after subsequent diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1807
129,184
27.07.2021 09:58:35
14,400
077bdd9ffd63907b74b288050b24713ec0c65b6a
[native] Get rid of `core-module-shim` Summary: Got rid of `core-module-shim` altogether Test Plan: Tested on iOS Simulator on debug/release, will test android before landing Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/data/core-data-provider.react.js", "new_path": "native/data/core-data-provider.react.js", "diff": "// @flow\n-import './core-module-shim';\nimport * as React from 'react';\nimport { useSelector } from 'react-redux';\n" }, { "change_type": "MODIFY", "old_path": "native/data/core-data.js", "new_path": "native/data/core-data.js", "diff": "// @flow\n-import './core-module-shim';\nimport * as React from 'react';\nimport { draftKeyFromThreadID } from 'lib/shared/thread-utils';\n" }, { "change_type": "DELETE", "old_path": "native/data/core-module-shim.js", "new_path": null, "diff": "-// @flow\n-\n-import { type Spec } from '../schema/CommCoreModuleSchema';\n-\n-if (!global.CommCoreModule) {\n- console.warn(\n- 'Comm Core Module has not been attached! ' +\n- 'Some functionalities may not work properly.',\n- );\n- const SpecImpl: Spec = {\n- getDraft: () => Promise.resolve(''),\n- updateDraft: () => Promise.resolve(false),\n- moveDraft: () => Promise.resolve(false),\n- getAllDrafts: () => Promise.resolve([]),\n- removeAllDrafts: () => Promise.resolve(),\n- };\n- global.CommCoreModule = SpecImpl;\n-}\n" }, { "change_type": "MODIFY", "old_path": "native/root.react.js", "new_path": "native/root.react.js", "diff": "@@ -43,7 +43,6 @@ import Socket from './socket.react';\nimport { DarkTheme, LightTheme } from './themes/navigation';\nimport ThemeHandler from './themes/theme-handler.react';\nimport './themes/fonts';\n-import './data/core-module-shim';\nLogBox.ignoreLogs([\n// react-native-reanimated\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of `core-module-shim` Summary: Got rid of `core-module-shim` altogether Test Plan: Tested on iOS Simulator on debug/release, will test android before landing Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1808
129,184
27.07.2021 10:09:46
14,400
ad98badf8eb4e43efa3cb40924a1188f782e03b7
[native] Add `messages` table to `sqlite_orm:make_table` Summary: na Test Plan: na, will be tested w/ subsequent diffs Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "diff": "#pragma once\n#include \"entities/Draft.h\"\n+#include \"entities/Message.h\"\n#include <jsi/jsi.h>\n#include <string>\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "diff": "@@ -152,7 +152,17 @@ auto SQLiteQueryExecutor::getStorage() {\nmake_table(\n\"drafts\",\nmake_column(\"key\", &Draft::key, unique(), primary_key()),\n- make_column(\"text\", &Draft::text)));\n+ make_column(\"text\", &Draft::text)),\n+ make_table(\n+ \"messages\",\n+ make_column(\"id\", &Message::id, unique(), primary_key()),\n+ make_column(\"thread\", &Message::thread),\n+ make_column(\"user\", &Message::user),\n+ make_column(\"type\", &Message::type),\n+ make_column(\"future_type\", &Message::future_type),\n+ make_column(\"content\", &Message::content),\n+ make_column(\"time\", &Message::time),\n+ make_column(\"creation\", &Message::creation)));\nreturn storage;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add `messages` table to `sqlite_orm:make_table` Summary: na Test Plan: na, will be tested w/ subsequent diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1809
129,184
27.07.2021 10:21:31
14,400
4f1eb934bfd3851e383beefd7b08224fad6d0bbf
[CommCoreModule] Introduce `removeAllMessages()` Summary: Introduce `removeAllMessages` to CommCoreModule Test Plan: Will be tested in subsequent diffs Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "diff": "@@ -22,6 +22,7 @@ public:\nvirtual bool moveDraft(std::string oldKey, std::string newKey) const = 0;\nvirtual std::vector<Draft> getAllDrafts() const = 0;\nvirtual void removeAllDrafts() const = 0;\n+ virtual void removeAllMessages() const = 0;\n};\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "diff": "@@ -202,4 +202,8 @@ void SQLiteQueryExecutor::removeAllDrafts() const {\nSQLiteQueryExecutor::getStorage().remove_all<Draft>();\n}\n+void SQLiteQueryExecutor::removeAllMessages() const {\n+ SQLiteQueryExecutor::getStorage().remove_all<Message>();\n+}\n+\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h", "diff": "@@ -20,6 +20,7 @@ public:\nbool moveDraft(std::string oldKey, std::string newKey) const override;\nstd::vector<Draft> getAllDrafts() const override;\nvoid removeAllDrafts() const override;\n+ void removeAllMessages() const override;\n};\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp", "diff": "@@ -149,6 +149,28 @@ jsi::Value CommCoreModule::removeAllDrafts(jsi::Runtime &rt) {\n});\n}\n+jsi::Value CommCoreModule::removeAllMessages(jsi::Runtime &rt) {\n+ return createPromiseAsJSIValue(\n+ rt, [=](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {\n+ taskType job = [=, &innerRt]() {\n+ std::string error;\n+ try {\n+ DatabaseManager::getQueryExecutor().removeAllMessages();\n+ } catch (std::system_error &e) {\n+ error = e.what();\n+ }\n+ this->jsInvoker_->invokeAsync([=, &innerRt]() {\n+ if (error.size()) {\n+ promise->reject(error);\n+ return;\n+ }\n+ promise->resolve(jsi::Value::undefined());\n+ });\n+ };\n+ this->databaseThread.scheduleTask(job);\n+ });\n+}\n+\nCommCoreModule::CommCoreModule(\nstd::shared_ptr<facebook::react::CallInvoker> jsInvoker)\n: facebook::react::CommCoreModuleSchemaCxxSpecJSI(jsInvoker),\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -19,6 +19,7 @@ class CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\nconst jsi::String &newKey) override;\njsi::Value getAllDrafts(jsi::Runtime &rt) override;\njsi::Value removeAllDrafts(jsi::Runtime &rt) override;\n+ jsi::Value removeAllMessages(jsi::Runtime &rt) override;\npublic:\nCommCoreModule(std::shared_ptr<facebook::react::CallInvoker> jsInvoker);\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/NativeModules.cpp", "new_path": "native/cpp/CommonCpp/NativeModules/NativeModules.cpp", "diff": "@@ -52,6 +52,15 @@ static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllDrafts(\nreturn static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)\n->removeAllDrafts(rt);\n}\n+static jsi::Value\n+__hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllMessages(\n+ jsi::Runtime &rt,\n+ TurboModule &turboModule,\n+ const jsi::Value *args,\n+ size_t count) {\n+ return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)\n+ ->removeAllMessages(rt);\n+}\nCommCoreModuleSchemaCxxSpecJSI::CommCoreModuleSchemaCxxSpecJSI(\nstd::shared_ptr<CallInvoker> jsInvoker)\n@@ -66,6 +75,8 @@ CommCoreModuleSchemaCxxSpecJSI::CommCoreModuleSchemaCxxSpecJSI(\n0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllDrafts};\nmethodMap_[\"removeAllDrafts\"] = MethodMetadata{\n0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllDrafts};\n+ methodMap_[\"removeAllMessages\"] = MethodMetadata{\n+ 0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllMessages};\n}\n} // namespace react\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/NativeModules.h", "new_path": "native/cpp/CommonCpp/NativeModules/NativeModules.h", "diff": "@@ -27,6 +27,7 @@ public:\nconst jsi::String &newKey) = 0;\nvirtual jsi::Value getAllDrafts(jsi::Runtime &rt) = 0;\nvirtual jsi::Value removeAllDrafts(jsi::Runtime &rt) = 0;\n+ virtual jsi::Value removeAllMessages(jsi::Runtime &rt) = 0;\n};\n} // namespace react\n" }, { "change_type": "MODIFY", "old_path": "native/schema/CommCoreModuleSchema.js", "new_path": "native/schema/CommCoreModuleSchema.js", "diff": "@@ -16,6 +16,7 @@ export interface Spec extends TurboModule {\n+moveDraft: (oldKey: string, newKey: string) => Promise<boolean>;\n+getAllDrafts: () => Promise<$ReadOnlyArray<Draft>>;\n+removeAllDrafts: () => Promise<void>;\n+ +removeAllMessages: () => Promise<void>;\n}\nexport default (TurboModuleRegistry.getEnforcing<Spec>(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[CommCoreModule] Introduce `removeAllMessages()` Summary: Introduce `removeAllMessages` to CommCoreModule Test Plan: Will be tested in subsequent diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1810
129,184
27.07.2021 11:57:05
14,400
dc73337b78a9115c6d7d16c9769e9d4a3d4b5536
[CommCoreModule] Introduce `getAllMessages()` Summary: Introduce `getAllMessages` to CommCoreModule Test Plan: Builds.. will be tested in subsequent diffs Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "diff": "@@ -23,6 +23,7 @@ public:\nvirtual std::vector<Draft> getAllDrafts() const = 0;\nvirtual void removeAllDrafts() const = 0;\nvirtual void removeAllMessages() const = 0;\n+ virtual std::vector<Message> getAllMessages() const = 0;\n};\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "diff": "@@ -206,4 +206,8 @@ void SQLiteQueryExecutor::removeAllMessages() const {\nSQLiteQueryExecutor::getStorage().remove_all<Message>();\n}\n+std::vector<Message> SQLiteQueryExecutor::getAllMessages() const {\n+ return SQLiteQueryExecutor::getStorage().get_all<Message>();\n+}\n+\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h", "diff": "@@ -21,6 +21,7 @@ public:\nstd::vector<Draft> getAllDrafts() const override;\nvoid removeAllDrafts() const override;\nvoid removeAllMessages() const override;\n+ std::vector<Message> getAllMessages() const override;\n};\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp", "diff": "@@ -171,6 +171,52 @@ jsi::Value CommCoreModule::removeAllMessages(jsi::Runtime &rt) {\n});\n}\n+jsi::Value CommCoreModule::getAllMessages(jsi::Runtime &rt) {\n+ return createPromiseAsJSIValue(\n+ rt, [=](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {\n+ taskType job = [=, &innerRt]() {\n+ std::string error;\n+ std::vector<Message> messagesVector;\n+ size_t numMessages;\n+ try {\n+ messagesVector =\n+ DatabaseManager::getQueryExecutor().getAllMessages();\n+ numMessages = messagesVector.size();\n+ } catch (std::system_error &e) {\n+ error = e.what();\n+ }\n+ this->jsInvoker_->invokeAsync([=, &innerRt]() {\n+ if (error.size()) {\n+ promise->reject(error);\n+ return;\n+ }\n+ jsi::Array jsiMessages = jsi::Array(innerRt, numMessages);\n+ size_t writeIndex = 0;\n+ for (Message message : messagesVector) {\n+ auto jsiMessage = jsi::Object(innerRt);\n+ jsiMessage.setProperty(innerRt, \"id\", std::to_string(message.id));\n+ jsiMessage.setProperty(\n+ innerRt, \"thread\", std::to_string(message.thread));\n+ jsiMessage.setProperty(\n+ innerRt, \"user\", std::to_string(message.user));\n+ jsiMessage.setProperty(\n+ innerRt, \"type\", std::to_string(message.type));\n+ jsiMessage.setProperty(\n+ innerRt, \"future_type\", std::to_string(message.future_type));\n+ jsiMessage.setProperty(innerRt, \"content\", message.content);\n+ jsiMessage.setProperty(\n+ innerRt, \"time\", std::to_string(message.time));\n+ jsiMessage.setProperty(innerRt, \"creation\", message.creation);\n+\n+ jsiMessages.setValueAtIndex(innerRt, writeIndex++, jsiMessage);\n+ }\n+ promise->resolve(std::move(jsiMessages));\n+ });\n+ };\n+ this->databaseThread.scheduleTask(job);\n+ });\n+}\n+\nCommCoreModule::CommCoreModule(\nstd::shared_ptr<facebook::react::CallInvoker> jsInvoker)\n: facebook::react::CommCoreModuleSchemaCxxSpecJSI(jsInvoker),\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -20,6 +20,7 @@ class CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\njsi::Value getAllDrafts(jsi::Runtime &rt) override;\njsi::Value removeAllDrafts(jsi::Runtime &rt) override;\njsi::Value removeAllMessages(jsi::Runtime &rt) override;\n+ jsi::Value getAllMessages(jsi::Runtime &rt) override;\npublic:\nCommCoreModule(std::shared_ptr<facebook::react::CallInvoker> jsInvoker);\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/NativeModules.cpp", "new_path": "native/cpp/CommonCpp/NativeModules/NativeModules.cpp", "diff": "@@ -61,6 +61,14 @@ __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllMessages(\nreturn static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)\n->removeAllMessages(rt);\n}\n+static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllMessages(\n+ jsi::Runtime &rt,\n+ TurboModule &turboModule,\n+ const jsi::Value *args,\n+ size_t count) {\n+ return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)\n+ ->getAllMessages(rt);\n+}\nCommCoreModuleSchemaCxxSpecJSI::CommCoreModuleSchemaCxxSpecJSI(\nstd::shared_ptr<CallInvoker> jsInvoker)\n@@ -77,6 +85,8 @@ CommCoreModuleSchemaCxxSpecJSI::CommCoreModuleSchemaCxxSpecJSI(\n0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllDrafts};\nmethodMap_[\"removeAllMessages\"] = MethodMetadata{\n0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllMessages};\n+ methodMap_[\"getAllMessages\"] = MethodMetadata{\n+ 0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllMessages};\n}\n} // namespace react\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/NativeModules.h", "new_path": "native/cpp/CommonCpp/NativeModules/NativeModules.h", "diff": "@@ -28,6 +28,7 @@ public:\nvirtual jsi::Value getAllDrafts(jsi::Runtime &rt) = 0;\nvirtual jsi::Value removeAllDrafts(jsi::Runtime &rt) = 0;\nvirtual jsi::Value removeAllMessages(jsi::Runtime &rt) = 0;\n+ virtual jsi::Value getAllMessages(jsi::Runtime &rt) = 0;\n};\n} // namespace react\n" }, { "change_type": "MODIFY", "old_path": "native/schema/CommCoreModuleSchema.js", "new_path": "native/schema/CommCoreModuleSchema.js", "diff": "import { TurboModuleRegistry } from 'react-native';\nimport type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';\n-type Draft = {\n- +key: string,\n- +text: string,\n-};\n+import type { SQLiteMessageInfo, SQLiteDraftInfo } from '../types/core-module';\nexport interface Spec extends TurboModule {\n+getDraft: (key: string) => Promise<string>;\n- +updateDraft: (draft: Draft) => Promise<boolean>;\n+ +updateDraft: (draft: SQLiteDraftInfo) => Promise<boolean>;\n+moveDraft: (oldKey: string, newKey: string) => Promise<boolean>;\n- +getAllDrafts: () => Promise<$ReadOnlyArray<Draft>>;\n+ +getAllDrafts: () => Promise<$ReadOnlyArray<SQLiteDraftInfo>>;\n+removeAllDrafts: () => Promise<void>;\n+removeAllMessages: () => Promise<void>;\n+ +getAllMessages: () => Promise<$ReadOnlyArray<SQLiteMessageInfo>>;\n}\nexport default (TurboModuleRegistry.getEnforcing<Spec>(\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/types/core-module.js", "diff": "+// @flow\n+\n+export type SQLiteMessageInfo = {\n+ +id: string,\n+ +thread: string,\n+ +user: string,\n+ +type: string,\n+ +futureType: string,\n+ +content: string,\n+ +time: string,\n+ +creation: string,\n+};\n+\n+export type SQLiteDraftInfo = {\n+ +key: string,\n+ +text: string,\n+};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[CommCoreModule] Introduce `getAllMessages()` Summary: Introduce `getAllMessages` to CommCoreModule Test Plan: Builds.. will be tested in subsequent diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1811
129,184
27.07.2021 12:17:15
14,400
eaa6483c02273a069d2d64d0a8b4d65dfa7a7832
[native] Introduce `MessageStoreOperation` and `processMessageStoreOperations` to `CommCoreModuleSchema` Summary: Introducing types + adding `processMessageStoreOperations` function to spec on js side Test Plan: Will be tested w/ subsequent diffs Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/schema/CommCoreModuleSchema.js", "new_path": "native/schema/CommCoreModuleSchema.js", "diff": "import { TurboModuleRegistry } from 'react-native';\nimport type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';\n-import type { SQLiteMessageInfo, SQLiteDraftInfo } from '../types/core-module';\n+export type SQLiteMessageInfo = {\n+ +id: string,\n+ +thread: string,\n+ +user: string,\n+ +type: string,\n+ +futureType: string,\n+ +content: string,\n+ +time: string,\n+ +creation: string,\n+};\n+\n+export type SQLiteDraftInfo = {\n+ +key: string,\n+ +text: string,\n+};\n+\n+export type RemoveMessageOperation = {\n+ +type: 'remove',\n+ +payload: { +id: string },\n+};\n+\n+export type ReplaceMessageOperation = {\n+ +type: 'replace',\n+ +payload: SQLiteMessageInfo,\n+};\n+\n+export type MessageStoreOperation =\n+ | RemoveMessageOperation\n+ | ReplaceMessageOperation;\nexport interface Spec extends TurboModule {\n+getDraft: (key: string) => Promise<string>;\n@@ -15,6 +43,9 @@ export interface Spec extends TurboModule {\n+removeAllDrafts: () => Promise<void>;\n+removeAllMessages: () => Promise<void>;\n+getAllMessages: () => Promise<$ReadOnlyArray<SQLiteMessageInfo>>;\n+ +processMessageStoreOperations: (\n+ operations: $ReadOnlyArray<MessageStoreOperation>,\n+ ) => Promise<void>;\n}\nexport default (TurboModuleRegistry.getEnforcing<Spec>(\n" }, { "change_type": "DELETE", "old_path": "native/types/core-module.js", "new_path": null, "diff": "-// @flow\n-\n-export type SQLiteMessageInfo = {\n- +id: string,\n- +thread: string,\n- +user: string,\n- +type: string,\n- +futureType: string,\n- +content: string,\n- +time: string,\n- +creation: string,\n-};\n-\n-export type SQLiteDraftInfo = {\n- +key: string,\n- +text: string,\n-};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Introduce `MessageStoreOperation` and `processMessageStoreOperations` to `CommCoreModuleSchema` Summary: Introducing types + adding `processMessageStoreOperations` function to spec on js side Test Plan: Will be tested w/ subsequent diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1812
129,184
27.07.2021 14:04:28
14,400
afb7a4de3e7db4134fae603a6cef5590190ef438
[CommCoreModule] Handle message removal in `processMessageStoreOperations` Summary: Create list of ids to be removed in `processMessageStoreOperations` and pass to `sqlite_orm:remove<Message>(ids);` Test Plan: Will test with subsequent diffs Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "diff": "@@ -24,6 +24,7 @@ public:\nvirtual void removeAllDrafts() const = 0;\nvirtual void removeAllMessages() const = 0;\nvirtual std::vector<Message> getAllMessages() const = 0;\n+ virtual void removeMessages(std::vector<int> ids) const = 0;\n};\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "diff": "@@ -210,4 +210,8 @@ std::vector<Message> SQLiteQueryExecutor::getAllMessages() const {\nreturn SQLiteQueryExecutor::getStorage().get_all<Message>();\n}\n+void SQLiteQueryExecutor::removeMessages(std::vector<int> ids) const {\n+ SQLiteQueryExecutor::getStorage().remove<Message>(ids);\n+}\n+\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h", "diff": "@@ -22,6 +22,7 @@ public:\nvoid removeAllDrafts() const override;\nvoid removeAllMessages() const override;\nstd::vector<Message> getAllMessages() const override;\n+ void removeMessages(std::vector<int> ids) const override;\n};\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp", "diff": "@@ -217,6 +217,45 @@ jsi::Value CommCoreModule::getAllMessages(jsi::Runtime &rt) {\n});\n}\n+#define REMOVE_OPERATION \"remove\"\n+\n+jsi::Value CommCoreModule::processMessageStoreOperations(\n+ jsi::Runtime &rt,\n+ const jsi::Array &operations) {\n+ std::vector<int> removed_msg_ids;\n+ for (auto idx = 0; idx < operations.size(rt); idx++) {\n+ auto op = operations.getValueAtIndex(rt, idx).asObject(rt);\n+ auto op_type = op.getProperty(rt, \"type\").asString(rt).utf8(rt);\n+\n+ if (op_type == REMOVE_OPERATION) {\n+ auto payload_obj = op.getProperty(rt, \"payload\").asObject(rt);\n+ auto msg_idx =\n+ std::stoi(payload_obj.getProperty(rt, \"id\").asString(rt).utf8(rt));\n+ removed_msg_ids.push_back(msg_idx);\n+ }\n+ }\n+\n+ return createPromiseAsJSIValue(\n+ rt, [=](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {\n+ taskType job = [=, &innerRt]() {\n+ std::string error;\n+ try {\n+ DatabaseManager::getQueryExecutor().removeMessages(removed_msg_ids);\n+ } catch (std::system_error &e) {\n+ error = e.what();\n+ }\n+ this->jsInvoker_->invokeAsync([=, &innerRt]() {\n+ if (error.size()) {\n+ promise->reject(error);\n+ } else {\n+ promise->resolve(jsi::Value::undefined());\n+ }\n+ });\n+ };\n+ this->databaseThread.scheduleTask(job);\n+ });\n+}\n+\nCommCoreModule::CommCoreModule(\nstd::shared_ptr<facebook::react::CallInvoker> jsInvoker)\n: facebook::react::CommCoreModuleSchemaCxxSpecJSI(jsInvoker),\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -21,6 +21,9 @@ class CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\njsi::Value removeAllDrafts(jsi::Runtime &rt) override;\njsi::Value removeAllMessages(jsi::Runtime &rt) override;\njsi::Value getAllMessages(jsi::Runtime &rt) override;\n+ jsi::Value processMessageStoreOperations(\n+ jsi::Runtime &rt,\n+ const jsi::Array &operations) override;\npublic:\nCommCoreModule(std::shared_ptr<facebook::react::CallInvoker> jsInvoker);\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/NativeModules.cpp", "new_path": "native/cpp/CommonCpp/NativeModules/NativeModules.cpp", "diff": "@@ -69,6 +69,15 @@ static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllMessages(\nreturn static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)\n->getAllMessages(rt);\n}\n+static jsi::Value\n+__hostFunction_CommCoreModuleSchemaCxxSpecJSI_processMessageStoreOperations(\n+ jsi::Runtime &rt,\n+ TurboModule &turboModule,\n+ const jsi::Value *args,\n+ size_t count) {\n+ return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)\n+ ->processMessageStoreOperations(rt, args[0].getObject(rt).getArray(rt));\n+}\nCommCoreModuleSchemaCxxSpecJSI::CommCoreModuleSchemaCxxSpecJSI(\nstd::shared_ptr<CallInvoker> jsInvoker)\n@@ -87,6 +96,9 @@ CommCoreModuleSchemaCxxSpecJSI::CommCoreModuleSchemaCxxSpecJSI(\n0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllMessages};\nmethodMap_[\"getAllMessages\"] = MethodMetadata{\n0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllMessages};\n+ methodMap_[\"processMessageStoreOperations\"] = MethodMetadata{\n+ 1,\n+ __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processMessageStoreOperations};\n}\n} // namespace react\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/NativeModules.h", "new_path": "native/cpp/CommonCpp/NativeModules/NativeModules.h", "diff": "@@ -29,6 +29,9 @@ public:\nvirtual jsi::Value removeAllDrafts(jsi::Runtime &rt) = 0;\nvirtual jsi::Value removeAllMessages(jsi::Runtime &rt) = 0;\nvirtual jsi::Value getAllMessages(jsi::Runtime &rt) = 0;\n+ virtual jsi::Value processMessageStoreOperations(\n+ jsi::Runtime &rt,\n+ const jsi::Array &operations) = 0;\n};\n} // namespace react\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[CommCoreModule] Handle message removal in `processMessageStoreOperations` Summary: Create list of ids to be removed in `processMessageStoreOperations` and pass to `sqlite_orm:remove<Message>(ids);` Test Plan: Will test with subsequent diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1813
129,184
27.07.2021 14:59:31
14,400
6c65c7a507576aaed6eed1b6032223b98599908d
[CommCoreModule] Handle message replacement in `processMessageStoreOperations` Summary: Create list of `Message`s to be replaced in `processMessageStoreOperations` and pass to `sqlite_orm:replace(message);` Currently there is a separate sql query for each message Test Plan: Will be tested with subsequent diffs Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h", "diff": "@@ -25,6 +25,7 @@ public:\nvirtual void removeAllMessages() const = 0;\nvirtual std::vector<Message> getAllMessages() const = 0;\nvirtual void removeMessages(std::vector<int> ids) const = 0;\n+ virtual void replaceMessage(Message message) const = 0;\n};\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "diff": "@@ -214,4 +214,8 @@ void SQLiteQueryExecutor::removeMessages(std::vector<int> ids) const {\nSQLiteQueryExecutor::getStorage().remove<Message>(ids);\n}\n+void SQLiteQueryExecutor::replaceMessage(Message message) const {\n+ SQLiteQueryExecutor::getStorage().replace(message);\n+}\n+\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h", "diff": "@@ -23,6 +23,7 @@ public:\nvoid removeAllMessages() const override;\nstd::vector<Message> getAllMessages() const override;\nvoid removeMessages(std::vector<int> ids) const override;\n+ void replaceMessage(Message message) const override;\n};\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp", "diff": "@@ -218,11 +218,15 @@ jsi::Value CommCoreModule::getAllMessages(jsi::Runtime &rt) {\n}\n#define REMOVE_OPERATION \"remove\"\n+#define REPLACE_OPERATION \"replace\"\njsi::Value CommCoreModule::processMessageStoreOperations(\njsi::Runtime &rt,\nconst jsi::Array &operations) {\n+\nstd::vector<int> removed_msg_ids;\n+ std::vector<Message> replaced_msgs;\n+\nfor (auto idx = 0; idx < operations.size(rt); idx++) {\nauto op = operations.getValueAtIndex(rt, idx).asObject(rt);\nauto op_type = op.getProperty(rt, \"type\").asString(rt).utf8(rt);\n@@ -232,6 +236,27 @@ jsi::Value CommCoreModule::processMessageStoreOperations(\nauto msg_idx =\nstd::stoi(payload_obj.getProperty(rt, \"id\").asString(rt).utf8(rt));\nremoved_msg_ids.push_back(msg_idx);\n+\n+ } else if (op_type == REPLACE_OPERATION) {\n+ auto msg_obj = op.getProperty(rt, \"payload\").asObject(rt);\n+\n+ auto id = std::stoi(msg_obj.getProperty(rt, \"id\").asString(rt).utf8(rt));\n+ auto thread =\n+ std::stoi(msg_obj.getProperty(rt, \"thread\").asString(rt).utf8(rt));\n+ auto user =\n+ std::stoi(msg_obj.getProperty(rt, \"user\").asString(rt).utf8(rt));\n+ auto type =\n+ std::stoi(msg_obj.getProperty(rt, \"type\").asString(rt).utf8(rt));\n+ auto future_type = std::stoi(\n+ msg_obj.getProperty(rt, \"future_type\").asString(rt).utf8(rt));\n+ auto content = msg_obj.getProperty(rt, \"content\").asString(rt).utf8(rt);\n+ auto time =\n+ std::stoi(msg_obj.getProperty(rt, \"time\").asString(rt).utf8(rt));\n+ auto creation = msg_obj.getProperty(rt, \"creation\").asString(rt).utf8(rt);\n+\n+ Message message = {\n+ id, thread, user, type, future_type, content, time, creation};\n+ replaced_msgs.push_back(message);\n}\n}\n@@ -241,6 +266,9 @@ jsi::Value CommCoreModule::processMessageStoreOperations(\nstd::string error;\ntry {\nDatabaseManager::getQueryExecutor().removeMessages(removed_msg_ids);\n+ for (const auto &msg : replaced_msgs) {\n+ DatabaseManager::getQueryExecutor().replaceMessage(msg);\n+ }\n} catch (std::system_error &e) {\nerror = e.what();\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[CommCoreModule] Handle message replacement in `processMessageStoreOperations` Summary: Create list of `Message`s to be replaced in `processMessageStoreOperations` and pass to `sqlite_orm:replace(message);` Currently there is a separate sql query for each message Test Plan: Will be tested with subsequent diffs Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1816
129,190
28.07.2021 13:42:37
-7,200
ac4db13d95c4a02e5b051cd7913d4f08f5e18296
[native] More clear function type for `MigrationFunction` Summary: I just thought this is more clear, what do you think? Test Plan: build Reviewers: palys-swm, atul, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "new_path": "native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp", "diff": "@@ -97,7 +97,7 @@ bool create_messages_table(sqlite3 *db) {\nreturn false;\n}\n-typedef bool (*MigrationFunction)(sqlite3 *db);\n+typedef std::function<bool(sqlite3 *)> MigrationFunction;\nstd::vector<std::pair<uint, MigrationFunction>> migrations{\n{{1, create_drafts_table},\n{2, rename_threadID_to_key},\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] More clear function type for `MigrationFunction` Summary: I just thought this is more clear, what do you think? Test Plan: build Reviewers: palys-swm, atul, ashoat Reviewed By: palys-swm, atul, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1792
129,191
28.07.2021 12:52:37
-7,200
bb573072612e875d52068b6762731797d928ab3c
[native] Adjust message target position when author name is displayed in tooltip Summary: We need to include an additional offset when an author name is displayed. Test Plan: Test message animation when a source message wasn't created by a viewer. Reviewers: ashoat Subscribers: Adrian, atul, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/utils.js", "new_path": "native/chat/utils.js", "diff": "@@ -11,6 +11,7 @@ import { useSelector } from '../redux/redux-utils';\nimport type { LayoutCoordinates, VerticalBounds } from '../types/layout-types';\nimport type { AnimatedViewStyle } from '../types/styles';\nimport { ChatContext, useHeightMeasurer } from './chat-context';\n+import { authorNameHeight } from './message-header.react';\nimport type { ChatMessageItemWithHeight } from './message-list-container.react';\nimport {\ntype ChatMessageInfoItemWithHeight,\n@@ -100,11 +101,15 @@ function useMessageTargetParameters(\nsourceMessageID,\n]);\n+ const authorNameComponentHeight = sourceMessage.messageInfo.creator.isViewer\n+ ? 0\n+ : authorNameHeight;\nconst currentDistanceFromBottom =\nmessageListVerticalBounds.height +\nmessageListVerticalBounds.y -\ninitialCoordinates.y +\n- timestampHeight;\n+ timestampHeight +\n+ authorNameComponentHeight;\nreturn {\nposition: targetDistanceFromBottom - currentDistanceFromBottom,\ncolor: sidebarThreadInfo.color,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Adjust message target position when author name is displayed in tooltip Summary: We need to include an additional offset when an author name is displayed. Test Plan: Test message animation when a source message wasn't created by a viewer. Reviewers: ashoat Reviewed By: ashoat Subscribers: Adrian, atul, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1818
129,184
28.07.2021 11:42:18
14,400
33f0c2104cffa1ca03679d1b920f5ad514febec6
[native] Increase markdown link contrast Summary: Addresses Test Plan: na, looks as expected Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/markdown/styles.js", "new_path": "native/markdown/styles.js", "diff": "@@ -8,7 +8,7 @@ import type { GlobalTheme } from '../types/themes';\nconst unboundStyles = {\nlink: {\n- color: 'link',\n+ color: 'markdownLink',\ntextDecorationLine: 'underline',\n},\nitalics: {\n" }, { "change_type": "MODIFY", "old_path": "native/themes/colors.js", "new_path": "native/themes/colors.js", "diff": "@@ -19,6 +19,7 @@ const light = Object.freeze({\nredText: '#AA0000',\ngreenText: 'green',\nlink: '#036AFF',\n+ markdownLink: '#000000',\npanelBackground: '#E9E9EF',\npanelBackgroundLabel: '#888888',\npanelForeground: 'white',\n@@ -88,6 +89,7 @@ const dark: Colors = Object.freeze({\nredText: '#FF4444',\ngreenText: '#44FF44',\nlink: '#129AFF',\n+ markdownLink: '#FFFFFF',\npanelBackground: '#0A0A0A',\npanelBackgroundLabel: '#C7C7CC',\npanelForeground: '#1D1D1D',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Increase markdown link contrast Summary: Addresses https://www.notion.so/commapp/Make-markdown-links-white-45abc3430daf4e999519d5d58054e9cc?d=08a1b372-bf19-4392-b981-f5eff146934a Test Plan: na, looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1824
129,187
29.07.2021 02:39:25
14,400
c05a9ffe9dc758847dbc509de57f248c2f74ea46
[native] Support optional triggerReply and triggerSidebar in SwipeableMessage Summary: It should be possible to support just reply, just sidebar, or both. Test Plan: Tested in combination with following diffs Reviewers: palys-swm Subscribers: Adrian, atul, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/swipeable-message.react.js", "new_path": "native/chat/swipeable-message.react.js", "diff": "@@ -26,8 +26,8 @@ import type { ViewStyle } from '../types/styles';\nimport { dividePastDistance } from '../utils/animation-utils';\nimport { useMessageListScreenWidth } from './composed-message-width';\n-const replyThreshold = 40;\n-const sidebarThreshold = 120;\n+const primaryThreshold = 40;\n+const secondaryThreshold = 120;\nfunction makeSpringConfig(velocity: number) {\n'worklet';\n@@ -42,19 +42,19 @@ function makeSpringConfig(velocity: number) {\n};\n}\n-function interpolateOpacityForViewerReplySnake(translateX: number) {\n+function interpolateOpacityForViewerPrimarySnake(translateX: number) {\n'worklet';\nreturn interpolate(translateX, [-20, -5], [1, 0], Extrapolate.CLAMP);\n}\n-function interpolateOpacityForNonViewerReplySnake(translateX: number) {\n+function interpolateOpacityForNonViewerPrimarySnake(translateX: number) {\n'worklet';\nreturn interpolate(translateX, [5, 20], [0, 1], Extrapolate.CLAMP);\n}\n-function interpolateTranslateXForViewerSidebarSnake(translateX: number) {\n+function interpolateTranslateXForViewerSecondarySnake(translateX: number) {\n'worklet';\nreturn interpolate(translateX, [-130, -120, -60, 0], [-130, -120, -5, 20]);\n}\n-function interpolateTranslateXForNonViewerSidebarSnake(translateX: number) {\n+function interpolateTranslateXForNonViewerSecondarySnake(translateX: number) {\n'worklet';\nreturn interpolate(translateX, [0, 80, 120, 130], [0, 30, 120, 130]);\n}\n@@ -139,8 +139,8 @@ function SwipeSnake<IconGlyphs: string>(\n}\ntype Props = {\n- +triggerReply: () => void,\n- +triggerSidebar: () => void,\n+ +triggerReply?: () => void,\n+ +triggerSidebar?: () => void,\n+isViewer: boolean,\n+messageBoxStyle: ViewStyle,\n+threadColor: string,\n@@ -148,12 +148,32 @@ type Props = {\n};\nfunction SwipeableMessage(props: Props): React.Node {\nconst { isViewer, triggerReply, triggerSidebar } = props;\n- const onPassReplyThreshold = React.useCallback(() => {\n- Haptics.impactAsync();\n- }, []);\n- const onPassSidebarThreshold = React.useCallback(() => {\n+ const secondaryActionExists = triggerReply && triggerSidebar;\n+\n+ const onPassPrimaryThreshold = React.useCallback(() => {\n+ const impactStrength = secondaryActionExists\n+ ? Haptics.ImpactFeedbackStyle.Medium\n+ : Haptics.ImpactFeedbackStyle.Heavy;\n+ Haptics.impactAsync(impactStrength);\n+ }, [secondaryActionExists]);\n+ const onPassSecondaryThreshold = React.useCallback(() => {\n+ if (secondaryActionExists) {\nHaptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);\n- }, []);\n+ }\n+ }, [secondaryActionExists]);\n+\n+ const primaryAction = React.useCallback(() => {\n+ if (triggerReply) {\n+ triggerReply();\n+ } else if (triggerSidebar) {\n+ triggerSidebar();\n+ }\n+ }, [triggerReply, triggerSidebar]);\n+ const secondaryAction = React.useCallback(() => {\n+ if (triggerReply && triggerSidebar) {\n+ triggerSidebar();\n+ }\n+ }, [triggerReply, triggerSidebar]);\nconst translateX = useSharedValue(0);\nconst swipeEvent = useAnimatedGestureHandler(\n@@ -169,35 +189,42 @@ function SwipeableMessage(props: Props): React.Node {\n: Math.max(translationX, 0);\ntranslateX.value = dividePastDistance(\nbaseActiveTranslation,\n- replyThreshold,\n+ primaryThreshold,\n2,\n);\nconst absValue = Math.abs(translateX.value);\n- const pastReplyThreshold = absValue >= replyThreshold;\n- if (pastReplyThreshold && !ctx.prevPastReplyThreshold) {\n- runOnJS(onPassReplyThreshold)();\n+ const pastPrimaryThreshold = absValue >= primaryThreshold;\n+ if (pastPrimaryThreshold && !ctx.prevPastPrimaryThreshold) {\n+ runOnJS(onPassPrimaryThreshold)();\n}\n- ctx.prevPastReplyThreshold = pastReplyThreshold;\n+ ctx.prevPastPrimaryThreshold = pastPrimaryThreshold;\n- const pastSidebarThreshold = absValue >= sidebarThreshold;\n- if (pastSidebarThreshold && !ctx.prevPastSidebarThreshold) {\n- runOnJS(onPassSidebarThreshold)();\n+ const pastSecondaryThreshold = absValue >= secondaryThreshold;\n+ if (pastSecondaryThreshold && !ctx.prevPastSecondaryThreshold) {\n+ runOnJS(onPassSecondaryThreshold)();\n}\n- ctx.prevPastSidebarThreshold = pastSidebarThreshold;\n+ ctx.prevPastSecondaryThreshold = pastSecondaryThreshold;\n},\nonEnd: event => {\nconst absValue = Math.abs(translateX.value);\n- if (absValue >= sidebarThreshold) {\n- runOnJS(triggerSidebar)();\n- } else if (absValue >= replyThreshold) {\n- runOnJS(triggerReply)();\n+ if (absValue >= secondaryThreshold && secondaryActionExists) {\n+ runOnJS(secondaryAction)();\n+ } else if (absValue >= primaryThreshold) {\n+ runOnJS(primaryAction)();\n}\ntranslateX.value = withSpring(0, makeSpringConfig(event.velocityX));\n},\n},\n- [isViewer, triggerReply, triggerSidebar],\n+ [\n+ isViewer,\n+ onPassPrimaryThreshold,\n+ onPassSecondaryThreshold,\n+ primaryAction,\n+ secondaryAction,\n+ secondaryActionExists,\n+ ],\n);\nconst transformMessageBoxStyle = useAnimatedStyle(\n@@ -213,35 +240,60 @@ function SwipeableMessage(props: Props): React.Node {\nconst threadColor = `#${props.threadColor}`;\nconst tinyThreadColor = tinycolor(threadColor);\n- const darkerThreadColor = tinyThreadColor\n- .darken(tinyThreadColor.isDark() ? 10 : 20)\n- .toString();\n+ const snakes = [];\n+ if (triggerReply) {\nconst replySnakeOpacityInterpolator = isViewer\n- ? interpolateOpacityForViewerReplySnake\n- : interpolateOpacityForNonViewerReplySnake;\n- const sidebarSnakeTranslateXInterpolator = isViewer\n- ? interpolateTranslateXForViewerSidebarSnake\n- : interpolateTranslateXForNonViewerSidebarSnake;\n-\n- return (\n- <>\n+ ? interpolateOpacityForViewerPrimarySnake\n+ : interpolateOpacityForNonViewerPrimarySnake;\n+ snakes.push(\n<SwipeSnake\nisViewer={isViewer}\ntranslateX={translateX}\ncolor={threadColor}\nopacityInterpolator={replySnakeOpacityInterpolator}\n+ key=\"reply\"\n>\n<FontAwesomeIcon name=\"reply\" size={16} />\n- </SwipeSnake>\n+ </SwipeSnake>,\n+ );\n+ }\n+ if (triggerReply && triggerSidebar) {\n+ const sidebarSnakeTranslateXInterpolator = isViewer\n+ ? interpolateTranslateXForViewerSecondarySnake\n+ : interpolateTranslateXForNonViewerSecondarySnake;\n+ const darkerThreadColor = tinyThreadColor\n+ .darken(tinyThreadColor.isDark() ? 10 : 20)\n+ .toString();\n+ snakes.push(\n<SwipeSnake\nisViewer={isViewer}\ntranslateX={translateX}\ncolor={darkerThreadColor}\ntranslateXInterpolator={sidebarSnakeTranslateXInterpolator}\n+ key=\"sidebar\"\n>\n<MaterialCommunityIcon name=\"comment-text\" size={16} />\n- </SwipeSnake>\n+ </SwipeSnake>,\n+ );\n+ } else if (triggerSidebar) {\n+ const sidebarSnakeOpacityInterpolator = isViewer\n+ ? interpolateOpacityForViewerPrimarySnake\n+ : interpolateOpacityForNonViewerPrimarySnake;\n+ snakes.push(\n+ <SwipeSnake\n+ isViewer={isViewer}\n+ translateX={translateX}\n+ color={threadColor}\n+ opacityInterpolator={sidebarSnakeOpacityInterpolator}\n+ key=\"sidebar\"\n+ >\n+ <MaterialCommunityIcon name=\"comment-text\" size={16} />\n+ </SwipeSnake>,\n+ );\n+ }\n+\n+ snakes.push(\n<PanGestureHandler\nmaxPointers={1}\nminDist={4}\n@@ -249,13 +301,15 @@ function SwipeableMessage(props: Props): React.Node {\nfailOffsetX={isViewer ? 5 : -5}\nfailOffsetY={[-5, 5]}\nwaitFor={waitFor}\n+ key=\"gesture\"\n>\n<Animated.View style={[messageBoxStyle, transformMessageBoxStyle]}>\n{children}\n</Animated.View>\n- </PanGestureHandler>\n- </>\n+ </PanGestureHandler>,\n);\n+\n+ return snakes;\n}\nconst styles = {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Support optional triggerReply and triggerSidebar in SwipeableMessage Summary: It should be possible to support just reply, just sidebar, or both. Test Plan: Tested in combination with following diffs Reviewers: palys-swm Reviewed By: palys-swm Subscribers: Adrian, atul, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1825
129,187
29.07.2021 03:03:42
14,400
2f18b181f80c455b3565901bdf4b0f05d62d78f8
[native] Support swipe-for-sidebar in MultimediaMessage Summary: This was surprisingly easy! Test Plan: Test by swiping a multimedia message Reviewers: palys-swm Subscribers: Adrian, atul, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -30,7 +30,7 @@ type BaseProps = {\n+item: ChatMessageInfoItemWithHeight,\n+sendFailed: boolean,\n+focused: boolean,\n- +swipeOptions?: SwipeOptions,\n+ +swipeOptions: SwipeOptions,\n+children: React.Node,\n};\ntype Props = {\n@@ -94,7 +94,7 @@ class ComposedMessage extends React.PureComponent<Props> {\n}\nlet messageBox;\n- if (swipeOptions && swipeOptions !== 'none') {\n+ if (swipeOptions !== 'none') {\nconst triggerReply =\nswipeOptions === 'reply' || swipeOptions === 'both'\n? this.reply\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -162,6 +162,13 @@ class MultimediaMessage extends React.PureComponent<Props, State> {\n});\n};\n+ canNavigateToSidebar() {\n+ return (\n+ this.props.item.threadCreatedFromMessage ||\n+ this.props.canCreateSidebarFromMessage\n+ );\n+ }\n+\nrender() {\nconst {\nitem,\n@@ -179,6 +186,7 @@ class MultimediaMessage extends React.PureComponent<Props, State> {\nitem={item}\nsendFailed={multimediaMessageSendFailed(item)}\nfocused={focused}\n+ swipeOptions={this.canNavigateToSidebar() ? 'sidebar' : 'none'}\n{...viewProps}\n>\n<View style={styles.expand} onLayout={this.onLayout} ref={this.viewRef}>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message.react.js", "new_path": "native/chat/text-message.react.js", "diff": "@@ -106,7 +106,7 @@ class TextMessage extends React.PureComponent<Props> {\n...viewProps\n} = this.props;\n- let swipeOptions;\n+ let swipeOptions = 'none';\nconst canReply = this.canReply();\nconst canNavigateToSidebar = this.canNavigateToSidebar();\nif (linkModalActive) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Support swipe-for-sidebar in MultimediaMessage Summary: This was surprisingly easy! Test Plan: Test by swiping a multimedia message Reviewers: palys-swm Reviewed By: palys-swm Subscribers: Adrian, atul, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1827
129,187
29.07.2021 03:09:36
14,400
c6dfb0c106bfd985c701d6949184fc1d23cf9cd2
[native] Handle non-swipeable case inside SwipeableMessage Summary: I think the code is more simple and readable this way. Test Plan: Test a variety of swipe cases Reviewers: palys-swm Subscribers: Adrian, atul, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -93,8 +93,6 @@ class ComposedMessage extends React.PureComponent<Props> {\n);\n}\n- let messageBox;\n- if (swipeOptions !== 'none') {\nconst triggerReply =\nswipeOptions === 'reply' || swipeOptions === 'both'\n? this.reply\n@@ -103,7 +101,7 @@ class ComposedMessage extends React.PureComponent<Props> {\nswipeOptions === 'sidebar' || swipeOptions === 'both'\n? navigateToSidebar\n: undefined;\n- messageBox = (\n+ const messageBox = (\n<View style={styles.messageBox}>\n<SwipeableMessage\ntriggerReply={triggerReply}\n@@ -116,11 +114,7 @@ class ComposedMessage extends React.PureComponent<Props> {\n</SwipeableMessage>\n</View>\n);\n- } else {\n- messageBox = (\n- <View style={[styles.messageBox, messageBoxStyle]}>{children}</View>\n- );\n- }\n+\nlet inlineSidebar = null;\nif (item.threadCreatedFromMessage) {\nconst positioning = isViewer ? 'right' : 'left';\n" }, { "change_type": "MODIFY", "old_path": "native/chat/swipeable-message.react.js", "new_path": "native/chat/swipeable-message.react.js", "diff": "@@ -238,6 +238,10 @@ function SwipeableMessage(props: Props): React.Node {\nconst reactNavGestureHandlerRef = React.useContext(GestureHandlerRefContext);\nconst waitFor = reactNavGestureHandlerRef ?? undefined;\n+ if (!triggerReply && !triggerSidebar) {\n+ return <View style={messageBoxStyle}>{children}</View>;\n+ }\n+\nconst threadColor = `#${props.threadColor}`;\nconst tinyThreadColor = tinycolor(threadColor);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Handle non-swipeable case inside SwipeableMessage Summary: I think the code is more simple and readable this way. Test Plan: Test a variety of swipe cases Reviewers: palys-swm Reviewed By: palys-swm Subscribers: Adrian, atul, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1828
129,190
30.07.2021 09:50:08
-7,200
77a3dc902126caf37fc275a93ed2ec4f0011c7b6
[native] Add olm persist entity Summary: please see the description here: D1794 Test Plan: none Reviewers: palys-swm, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul
[ { "change_type": "ADD", "old_path": null, "new_path": "native/cpp/CommonCpp/DatabaseManagers/entities/OlmPersistAccount.h", "diff": "+#pragma once\n+\n+#include <string>\n+\n+namespace comm {\n+\n+struct OlmPersistAccount {\n+ int id;\n+ std::string account_data;\n+};\n+\n+} // namespace comm\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/cpp/CommonCpp/DatabaseManagers/entities/OlmPersistSession.h", "diff": "+#pragma once\n+\n+#include <string>\n+\n+namespace comm {\n+\n+struct OlmPersistSession {\n+ std::string target_user_id;\n+ std::string session_data;\n+};\n+\n+} // namespace comm\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add olm persist entity Summary: please see the description here: D1794 Test Plan: none Reviewers: palys-swm, ashoat Reviewed By: palys-swm, ashoat Subscribers: ashoat, KatPo, palys-swm, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1793
129,184
02.08.2021 14:45:41
14,400
d24002b368a6d69040ff986dcc2b889ec8f3595a
[lib] Modify `ReassignmentResult` to include list of `MessageStoreOperation`s Summary: Modify ReassignmentResult to include a set of operations **in addition to the modified messageStore**. Test Plan: Set breakpoint and observed list of operations was returned as expected Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -65,6 +65,8 @@ import {\ntype RawMessageInfo,\ntype LocalMessageInfo,\ntype MessageStore,\n+ type ReplaceMessageOperation,\n+ type MessageStoreOperation,\ntype MessageTruncationStatus,\ntype ThreadMessageInfo,\ntype LocallyComposedMessageInfo,\n@@ -165,6 +167,7 @@ function freshMessageStore(\n}\ntype ReassignmentResult = {\n+ +messageStoreOperations: $ReadOnlyArray<MessageStoreOperation>,\n+messageStore: MessageStore,\n+reassignedThreadIDs: $ReadOnlyArray<string>,\n};\n@@ -177,6 +180,7 @@ function reassignMessagesToRealizedThreads(\nthreadInfos,\n);\n+ const messageStoreOperations: MessageStoreOperation[] = [];\nconst messages = {};\nfor (const storeMessageID in messageStore.messages) {\nconst message = messageStore.messages[storeMessageID];\n@@ -189,6 +193,17 @@ function reassignMessagesToRealizedThreads(\ntime: threadInfos[newThreadID]?.creationTime ?? message.time,\n}\n: message;\n+\n+ if (!newThreadID) {\n+ continue;\n+ }\n+\n+ const updateMsgOperation: ReplaceMessageOperation = {\n+ type: 'replace',\n+ payload: { id: storeMessageID, messageInfo: messages[storeMessageID] },\n+ };\n+\n+ messageStoreOperations.push(updateMsgOperation);\n}\nconst threads = {};\n@@ -214,6 +229,7 @@ function reassignMessagesToRealizedThreads(\n}\nreturn {\n+ messageStoreOperations,\nmessageStore: {\n...messageStore,\nthreads,\n" }, { "change_type": "MODIFY", "old_path": "lib/types/message-types.js", "new_path": "lib/types/message-types.js", "diff": "@@ -328,6 +328,20 @@ export type MessageStore = {\n+currentAsOf: number,\n};\n+export type RemoveMessageOperation = {\n+ +type: 'remove',\n+ +payload: { +id: string },\n+};\n+\n+export type ReplaceMessageOperation = {\n+ +type: 'replace',\n+ +payload: { +id: string, +messageInfo: RawMessageInfo },\n+};\n+\n+export type MessageStoreOperation =\n+ | RemoveMessageOperation\n+ | ReplaceMessageOperation;\n+\nexport const messageTruncationStatus = Object.freeze({\n// EXHAUSTIVE means we've reached the start of the thread. Either the result\n// set includes the very first message for that thread, or there is nothing\n" }, { "change_type": "MODIFY", "old_path": "native/schema/CommCoreModuleSchema.js", "new_path": "native/schema/CommCoreModuleSchema.js", "diff": "import { TurboModuleRegistry } from 'react-native';\nimport type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';\n-export type SQLiteMessageInfo = {\n+type SQLiteMessageInfo = {\n+id: string,\n+thread: string,\n+user: string,\n@@ -16,24 +16,22 @@ export type SQLiteMessageInfo = {\n+creation: string,\n};\n-export type SQLiteDraftInfo = {\n+type SQLiteDraftInfo = {\n+key: string,\n+text: string,\n};\n-export type RemoveMessageOperation = {\n+type RemoveMessageOperation = {\n+type: 'remove',\n+payload: { +id: string },\n};\n-export type ReplaceMessageOperation = {\n+type ReplaceMessageOperation = {\n+type: 'replace',\n+payload: SQLiteMessageInfo,\n};\n-export type MessageStoreOperation =\n- | RemoveMessageOperation\n- | ReplaceMessageOperation;\n+type MessageStoreOperation = RemoveMessageOperation | ReplaceMessageOperation;\nexport interface Spec extends TurboModule {\n+getDraft: (key: string) => Promise<string>;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Modify `ReassignmentResult` to include list of `MessageStoreOperation`s Summary: Modify ReassignmentResult to include a set of operations **in addition to the modified messageStore**. Test Plan: Set breakpoint and observed list of operations was returned as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1832
129,184
02.08.2021 11:58:24
14,400
5228576649af6d2b7d0727f71f4c9d6df918a93a
[native] Use swmansion `cloud-filled` icon in `community-pill` Summary: Here's what it looks like: Test Plan: na, looks as expected Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/components/community-pill.react.js", "new_path": "native/components/community-pill.react.js", "diff": "import * as React from 'react';\nimport { View, StyleSheet } from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome5';\nimport { memberHasAdminPowers } from 'lib/shared/thread-utils';\nimport type { ThreadInfo, RelativeMemberInfo } from 'lib/types/thread-types';\n@@ -10,6 +9,7 @@ import type { ThreadInfo, RelativeMemberInfo } from 'lib/types/thread-types';\nimport { useSelector } from '../redux/redux-utils';\nimport { useColors } from '../themes/colors';\nimport Pill from './pill.react';\n+import SWMansionIcon from './swmansion-icon.react';\nimport ThreadPill from './thread-pill.react';\ntype Props = {\n@@ -33,7 +33,11 @@ function CommunityPill(props: Props): React.Node {\nreturn undefined;\n}\nconst icon = (\n- <Icon name=\"cloud\" size={12} color={colors.panelForegroundLabel} />\n+ <SWMansionIcon\n+ name=\"cloud-filled\"\n+ size={20}\n+ color={colors.panelForegroundLabel}\n+ />\n);\nreturn (\n<Pill\n" }, { "change_type": "MODIFY", "old_path": "native/components/pill.react.js", "new_path": "native/components/pill.react.js", "diff": "@@ -70,7 +70,7 @@ const unboundStyles = {\nfontWeight: 'bold',\n},\nicon: {\n- paddingRight: 8,\n+ paddingRight: 6,\n},\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use swmansion `cloud-filled` icon in `community-pill` Summary: Here's what it looks like: https://blob.sh/atul/ed5b.png Test Plan: na, looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1836
129,184
02.08.2021 12:08:00
14,400
9820873e90ad7e13dab27f692d32fb1bcbbdbec6
[native] Use swmansion `reply-filled` and `sidebar-filled` icons in `swipeable-message` Summary: Here's what it looks like: Test Plan: na, looks as expected Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "native/chat/swipeable-message.react.js", "new_path": "native/chat/swipeable-message.react.js", "diff": "@@ -17,10 +17,9 @@ import Animated, {\ntype SharedValue,\n} from 'react-native-reanimated';\nimport type { IconProps } from 'react-native-vector-icons';\n-import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';\n-import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';\nimport tinycolor from 'tinycolor2';\n+import SWMansionIcon from '../components/swmansion-icon.react';\nimport { colors } from '../themes/colors';\nimport type { ViewStyle } from '../types/styles';\nimport { dividePastDistance } from '../utils/animation-utils';\n@@ -258,7 +257,7 @@ function SwipeableMessage(props: Props): React.Node {\nopacityInterpolator={replySnakeOpacityInterpolator}\nkey=\"reply\"\n>\n- <FontAwesomeIcon name=\"reply\" size={16} />\n+ <SWMansionIcon name=\"reply-filled\" size={20} />\n</SwipeSnake>,\n);\n}\n@@ -277,7 +276,7 @@ function SwipeableMessage(props: Props): React.Node {\ntranslateXInterpolator={sidebarSnakeTranslateXInterpolator}\nkey=\"sidebar\"\n>\n- <MaterialCommunityIcon name=\"comment-text\" size={16} />\n+ <SWMansionIcon name=\"sidebar-filled\" size={20} />\n</SwipeSnake>,\n);\n} else if (triggerSidebar) {\n@@ -292,7 +291,7 @@ function SwipeableMessage(props: Props): React.Node {\nopacityInterpolator={sidebarSnakeOpacityInterpolator}\nkey=\"sidebar\"\n>\n- <MaterialCommunityIcon name=\"comment-text\" size={16} />\n+ <SWMansionIcon name=\"sidebar-filled\" size={20} />\n</SwipeSnake>,\n);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use swmansion `reply-filled` and `sidebar-filled` icons in `swipeable-message` Summary: Here's what it looks like: https://blob.sh/atul/0c09.png Test Plan: na, looks as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1837
129,187
02.08.2021 22:54:10
18,000
e8ef4f72e213e24f82ed23096891e141f51c566c
[native] ALPHA -> BETA
[ { "change_type": "MODIFY", "old_path": "native/profile/build-info.react.js", "new_path": "native/profile/build-info.react.js", "diff": "@@ -17,7 +17,7 @@ function BuildInfo(props: { ... }): React.Node {\n<View style={styles.section}>\n<View style={styles.row}>\n<Text style={styles.label}>Release</Text>\n- <Text style={styles.releaseText}>ALPHA</Text>\n+ <Text style={styles.releaseText}>BETA</Text>\n</View>\n<View style={styles.row}>\n<Text style={styles.label}>Code version</Text>\n@@ -46,7 +46,7 @@ const unboundStyles = {\npaddingRight: 12,\n},\nreleaseText: {\n- color: 'redText',\n+ color: 'orange',\nfontSize: 16,\n},\nrow: {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] ALPHA -> BETA
129,187
02.08.2021 21:57:32
18,000
d5203951e99056fd0a90b55cf1e6aa8b95e53c6d
[native] codeVersion -> 94
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -284,8 +284,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 93\n- versionName '0.0.93'\n+ versionCode 94\n+ versionName '0.0.94'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.93</string>\n+ <string>0.0.94</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>93</string>\n+ <string>94</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.93</string>\n+ <string>0.0.94</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>93</string>\n+ <string>94</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -280,7 +280,7 @@ const persistConfig = {\ntimeout: ((__DEV__ ? 0 : undefined): number | void),\n};\n-const codeVersion = 93;\n+const codeVersion = 94;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 94
129,187
02.08.2021 15:23:18
18,000
f6fbdaa07413aba685512939b64b94a410e19c21
[server] Avoid defining visibleExtractString twice in message-fetchers.js Test Plan: Flow Reviewers: palys-swm, atul Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "server/src/fetchers/message-fetchers.js", "new_path": "server/src/fetchers/message-fetchers.js", "diff": "@@ -38,6 +38,8 @@ export type FetchCollapsableNotifsResult = {\n[userID: string]: CollapsableNotifInfo[],\n};\n+const visibleExtractString = `$.${threadPermissions.VISIBLE}.value`;\n+\n// This function doesn't filter RawMessageInfos based on what messageTypes the\n// client supports, since each user can have multiple clients. The caller must\n// handle this filtering.\n@@ -88,7 +90,6 @@ async function fetchCollapsableNotifs(\nreturn usersToCollapsableNotifInfo;\n}\n- const visPermissionExtractString = `$.${threadPermissions.VISIBLE}.value`;\nconst collapseQuery = SQL`\nSELECT m.id, m.thread AS threadID, m.content, m.time, m.type,\nm.user AS creatorID, stm.permissions AS subthread_permissions, n.user,\n@@ -104,7 +105,7 @@ async function fetchCollapsableNotifs(\nON m.type = ${messageTypes.CREATE_SUB_THREAD}\nAND stm.thread = m.content AND stm.user = n.user\nWHERE n.rescinded = 0 AND\n- JSON_EXTRACT(mm.permissions, ${visPermissionExtractString}) IS TRUE AND\n+ JSON_EXTRACT(mm.permissions, ${visibleExtractString}) IS TRUE AND\n`;\ncollapseQuery.append(mergeOrConditions(sqlTuples));\ncollapseQuery.append(SQL`ORDER BY m.time DESC`);\n@@ -239,8 +240,6 @@ function rawMessageInfoFromRows(\nreturn messageSpec.rawMessageInfoFromRow(row, { derivedMessages, localID });\n}\n-const visibleExtractString = `$.${threadPermissions.VISIBLE}.value`;\n-\nasync function fetchMessageInfos(\nviewer: Viewer,\ncriteria: ThreadSelectionCriteria,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Avoid defining visibleExtractString twice in message-fetchers.js Test Plan: Flow Reviewers: palys-swm, atul Reviewed By: atul Subscribers: Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1838
129,187
02.08.2021 15:24:09
18,000
3ba52c674f4da4606d966052a0b0b557d6f53205
[server] Introduce user_messages table Summary: More details in the [Notion task](https://www.notion.so/commapp/Make-an-adjacency-table-for-messages-dd9c546a39d44fac89b8f4a7670bbcab) Test Plan: I ran the script Reviewers: palys-swm, atul, karol-bisztyga Subscribers: Adrian
[ { "change_type": "MODIFY", "old_path": "server/src/scripts/create-db.js", "new_path": "server/src/scripts/create-db.js", "diff": "@@ -218,6 +218,14 @@ async function createTables() {\none_time_key CHAR(43) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n+ CREATE TABLE user_messages (\n+ recipient bigint(20) NOT NULL,\n+ thread bigint(20) NOT NULL,\n+ message bigint(20) NOT NULL,\n+ time bigint(20) NOT NULL,\n+ data mediumtext COLLATE utf8mb4_bin DEFAULT NULL\n+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;\n+\nALTER TABLE cookies\nADD PRIMARY KEY (id),\nADD UNIQUE KEY device_token (device_token),\n@@ -312,6 +320,12 @@ async function createTables() {\nALTER TABLE one_time_keys\nADD PRIMARY KEY (user, one_time_key);\n+ ALTER TABLE user_messages\n+ ADD INDEX recipient_time (recipient, time),\n+ ADD INDEX recipient_thread_time (recipient, thread, time),\n+ ADD INDEX thread (thread),\n+ ADD PRIMARY KEY (recipient, message);\n+\nALTER TABLE ids\nMODIFY id bigint(20) NOT NULL AUTO_INCREMENT;\n`);\n" }, { "change_type": "ADD", "old_path": null, "new_path": "server/src/scripts/create-user-messages-table.js", "diff": "+// @flow\n+\n+import { dbQuery, SQL } from '../database/database';\n+import { main } from './utils';\n+\n+async function createTable() {\n+ await dbQuery(SQL`\n+ CREATE TABLE IF NOT EXISTS user_messages (\n+ recipient bigint(20) NOT NULL,\n+ thread bigint(20) NOT NULL,\n+ message bigint(20) NOT NULL,\n+ time bigint(20) NOT NULL,\n+ data mediumtext COLLATE utf8mb4_bin DEFAULT NULL\n+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;\n+ `);\n+}\n+\n+async function addIndices() {\n+ try {\n+ await dbQuery(SQL`\n+ ALTER TABLE user_messages\n+ ADD INDEX recipient_time (recipient, time),\n+ ADD INDEX recipient_thread_time (recipient, thread, time),\n+ ADD INDEX thread (thread),\n+ ADD PRIMARY KEY (recipient, message);\n+ `);\n+ } catch {}\n+}\n+\n+main([createTable, addIndices]);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Introduce user_messages table Summary: More details in the [Notion task](https://www.notion.so/commapp/Make-an-adjacency-table-for-messages-dd9c546a39d44fac89b8f4a7670bbcab) Test Plan: I ran the script Reviewers: palys-swm, atul, karol-bisztyga Reviewed By: palys-swm Subscribers: Adrian Differential Revision: https://phabricator.ashoat.com/D1839
129,184
04.08.2021 09:27:26
14,400
aa87445c9263c01526bab5df45a99d8f1b0b20de
[lib] Introduce `processMessageStoreOperations` to `message-reducer` Summary: Introduce `processMessageStoreOperations`, which given a MessageStore and a list of MessageStoreOperations will apply the operations. Test Plan: Set breakpoint w/ simple replacement case and function behaved as expected Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -556,6 +556,22 @@ function ensureRealizedThreadIDIsUsedWhenPossible<\n: payload;\n}\n+// eslint-disable-next-line\n+function processMessageStoreOperations(\n+ messageStore: MessageStore,\n+ messageStoreOperations: $ReadOnlyArray<MessageStoreOperation>,\n+): MessageStore {\n+ const processedMessages = { ...messageStore.messages };\n+ for (const operation of messageStoreOperations) {\n+ if (operation.type === 'replace') {\n+ processedMessages[operation.payload.id] = operation.payload.messageInfo;\n+ } else if (operation.type === 'remove') {\n+ delete processedMessages[operation.payload.id];\n+ }\n+ }\n+ return { ...messageStore, messages: processedMessages };\n+}\n+\nfunction reduceMessageStore(\nmessageStore: MessageStore,\naction: BaseAction,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Introduce `processMessageStoreOperations` to `message-reducer` Summary: Introduce `processMessageStoreOperations`, which given a MessageStore and a list of MessageStoreOperations will apply the operations. Test Plan: Set breakpoint w/ simple replacement case and function behaved as expected Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1833
129,184
04.08.2021 10:02:36
14,400
f92c7bd6298bf88fc214a65446b4312d82977b1a
[lib] Modify `freshMessageStore` return type to include `messageStoreOperations` Summary: na Test Plan: Tested by logging in and making sure the messageStore.messages after processing operations matched freshStore Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -125,15 +125,25 @@ function threadIsWatched(\n);\n}\n+type FreshMessageStoreResult = {\n+ +messageStoreOperations: $ReadOnlyArray<MessageStoreOperation>,\n+ +messageStore: MessageStore,\n+};\nfunction freshMessageStore(\nmessageInfos: $ReadOnlyArray<RawMessageInfo>,\ntruncationStatus: { [threadID: string]: MessageTruncationStatus },\ncurrentAsOf: number,\nthreadInfos: { +[threadID: string]: RawThreadInfo },\n-): MessageStore {\n+): FreshMessageStoreResult {\nconst unshimmed = unshimMessageInfos(messageInfos);\nconst orderedMessageInfos = sortMessageInfoList(unshimmed);\nconst messages = _keyBy(messageID)(orderedMessageInfos);\n+\n+ const messageStoreOperations = orderedMessageInfos.map(messageInfo => ({\n+ type: 'replace',\n+ payload: { id: messageID(messageInfo), messageInfo },\n+ }));\n+\nconst threadsToMessageIDs = threadsToMessageIDsFromMessageInfos(\norderedMessageInfos,\n);\n@@ -164,7 +174,10 @@ function freshMessageStore(\nlastPruned,\n};\n}\n- return { messages, threads, local: {}, currentAsOf };\n+ return {\n+ messageStoreOperations,\n+ messageStore: { messages, threads, local: {}, currentAsOf },\n+ };\n}\ntype ReassignmentResult = {\n@@ -595,12 +608,27 @@ function reduceMessageStore(\n): MessageStore {\nif (action.type === logInActionTypes.success) {\nconst messagesResult = action.payload.messagesResult;\n- return freshMessageStore(\n+ const {\n+ messageStoreOperations,\n+ messageStore: freshStore,\n+ } = freshMessageStore(\nmessagesResult.messageInfos,\nmessagesResult.truncationStatus,\nmessagesResult.currentAsOf,\nnewThreadInfos,\n);\n+\n+ const processedMessageStore = processMessageStoreOperations(\n+ messageStore,\n+ messageStoreOperations,\n+ );\n+\n+ invariant(\n+ !isDev || _isEqual(processedMessageStore.messages)(freshStore.messages),\n+ 'messageStore.messages should be equal to processedMessageStore.messages',\n+ );\n+\n+ return freshStore;\n} else if (action.type === incrementalStateSyncActionType) {\nif (\naction.payload.messagesResult.rawMessageInfos.length === 0 &&\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -162,12 +162,13 @@ async function websiteResponder(\n{ threadInfos },\n{ rawMessageInfos, truncationStatuses },\n] = await Promise.all([threadInfoPromise, messageInfoPromise]);\n- return freshMessageStore(\n+ const { messageStore: freshStore } = freshMessageStore(\nrawMessageInfos,\ntruncationStatuses,\nmostRecentMessageTimestamp(rawMessageInfos, initialTime),\nthreadInfos,\n);\n+ return freshStore;\n})();\nconst entryStorePromise = (async () => {\nconst { rawEntryInfos } = await entryInfoPromise;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Modify `freshMessageStore` return type to include `messageStoreOperations` Summary: na Test Plan: Tested by logging in and making sure the messageStore.messages after processing operations matched freshStore Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1851
129,184
05.08.2021 17:16:37
14,400
b664894d739a7d186ca22972d3b18237a712256a
[lib] Modify `filterByNewThreadInfos` return type to include `messageStoreOperations` Summary: na Test Plan: Haven't yet tested Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -549,10 +549,14 @@ function mergeNewMessages(\nreturn { messages, threads, local, currentAsOf };\n}\n+type FilterByNewThreadInfosResult = {\n+ +messageStoreOperations: $ReadOnlyArray<MessageStoreOperation>,\n+ +messageStore: MessageStore,\n+};\nfunction filterByNewThreadInfos(\nmessageStore: MessageStore,\nthreadInfos: { +[id: string]: RawThreadInfo },\n-): MessageStore {\n+): FilterByNewThreadInfosResult {\nconst watchedIDs = threadWatcher.getWatchedIDs();\nconst watchedThreadInfos = _pickBy((threadInfo: RawThreadInfo) =>\nthreadIsWatched(threadInfo.id, threadInfo, watchedIDs),\n@@ -566,11 +570,20 @@ function filterByNewThreadInfos(\nmessageIDsToRemove.push(id);\n}\n}\n+\n+ const messageStoreOperations = messageIDsToRemove.map(id => ({\n+ type: 'remove',\n+ payload: { id },\n+ }));\n+\nreturn {\n+ messageStoreOperations,\n+ messageStore: {\nmessages: _omit(messageIDsToRemove)(messageStore.messages),\nthreads: _pick(Object.keys(watchedThreadInfos))(messageStore.threads),\nlocal: _omit(messageIDsToRemove)(messageStore.local),\ncurrentAsOf: messageStore.currentAsOf,\n+ },\n};\n}\n@@ -702,7 +715,24 @@ function reduceMessageStore(\naction.type === leaveThreadActionTypes.success ||\naction.type === setNewSessionActionType\n) {\n- return filterByNewThreadInfos(messageStore, newThreadInfos);\n+ const {\n+ messageStoreOperations,\n+ messageStore: filteredMessageStore,\n+ } = filterByNewThreadInfos(messageStore, newThreadInfos);\n+\n+ const processedMessageStore = processMessageStoreOperations(\n+ messageStore,\n+ messageStoreOperations,\n+ );\n+\n+ invariant(\n+ !isDev ||\n+ _isEqual(processedMessageStore.messages)(filteredMessageStore.messages),\n+ 'processedMessageStore.messages should be equal ' +\n+ 'to filteredMessageStore.messages',\n+ );\n+\n+ return filteredMessageStore;\n} else if (action.type === newThreadActionTypes.success) {\nconst messagesResult = mergeUpdatesWithMessageInfos(\naction.payload.newMessageInfos,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Modify `filterByNewThreadInfos` return type to include `messageStoreOperations` Summary: na Test Plan: Haven't yet tested Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1852
129,184
05.08.2021 17:29:30
14,400
9ae70cf9c493f5699ab8d26cd64c763a9cd74b9b
[lib] Modify `RemoveMessageOperation` payload to be array of messageIDs Summary: Makes more sense and aligns better w/ what we're doing on the sqlite side Test Plan: na Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -571,10 +571,9 @@ function filterByNewThreadInfos(\n}\n}\n- const messageStoreOperations = messageIDsToRemove.map(id => ({\n- type: 'remove',\n- payload: { id },\n- }));\n+ const messageStoreOperations = [\n+ { type: 'remove', payload: { ids: messageIDsToRemove } },\n+ ];\nreturn {\nmessageStoreOperations,\n@@ -608,7 +607,9 @@ function processMessageStoreOperations(\nif (operation.type === 'replace') {\nprocessedMessages[operation.payload.id] = operation.payload.messageInfo;\n} else if (operation.type === 'remove') {\n- delete processedMessages[operation.payload.id];\n+ for (const id of operation.payload.ids) {\n+ delete processedMessages[id];\n+ }\n}\n}\nreturn { ...messageStore, messages: processedMessages };\n" }, { "change_type": "MODIFY", "old_path": "lib/types/message-types.js", "new_path": "lib/types/message-types.js", "diff": "@@ -330,7 +330,7 @@ export type MessageStore = {\nexport type RemoveMessageOperation = {\n+type: 'remove',\n- +payload: { +id: string },\n+ +payload: { +ids: $ReadOnlyArray<string> },\n};\nexport type ReplaceMessageOperation = {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Modify `RemoveMessageOperation` payload to be array of messageIDs Summary: Makes more sense and aligns better w/ what we're doing on the sqlite side Test Plan: na Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1853
129,184
04.08.2021 14:09:37
14,400
7c0adac8550b54650540997820fb1347efddcf3e
[lib] Modify `mergeNewMessages` return type to include `messageStoreOperations` Summary: na Test Plan: in progress Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -253,6 +253,10 @@ function reassignMessagesToRealizedThreads(\n};\n}\n+type MergeNewMessagesResult = {\n+ +messageStoreOperations: $ReadOnlyArray<MessageStoreOperation>,\n+ +messageStore: MessageStore,\n+};\n// oldMessageStore is from the old state\n// newMessageInfos, truncationStatus come from server\nfunction mergeNewMessages(\n@@ -261,16 +265,16 @@ function mergeNewMessages(\ntruncationStatus: { [threadID: string]: MessageTruncationStatus },\nthreadInfos: { +[threadID: string]: RawThreadInfo },\nactionType: *,\n-): MessageStore {\n+): MergeNewMessagesResult {\nconst {\n- messageStoreOperations,\n+ messageStoreOperations: reassignMessagesOps,\nmessageStore: messageStoreAfterReassignment,\nreassignedThreadIDs,\n} = reassignMessagesToRealizedThreads(oldMessageStore, threadInfos);\nconst messageStoreAfterOperations = processMessageStoreOperations(\noldMessageStore,\n- messageStoreOperations,\n+ reassignMessagesOps,\n);\ninvariant(\n@@ -535,6 +539,15 @@ function mergeNewMessages(\n_keyBy(messageID),\n)([...orderedNewMessageInfos, ...oldMessageInfosToCombine]);\n+ const newMessages = _keyBy(messageID)(orderedNewMessageInfos);\n+ const newMessageOps: MessageStoreOperation[] = [];\n+ for (const id in newMessages) {\n+ newMessageOps.push({\n+ type: 'replace',\n+ payload: { id, messageInfo: newMessages[id] },\n+ });\n+ }\n+\nfor (const threadID of mustResortThreadMessageIDs) {\nthreads[threadID].messageIDs = sortMessageIDs(messages)(\nthreads[threadID].messageIDs,\n@@ -546,7 +559,22 @@ function mergeNewMessages(\nmessageStoreAfterReassignment.currentAsOf,\n);\n- return { messages, threads, local, currentAsOf };\n+ const mergedMessageStore = { messages, threads, local, currentAsOf };\n+\n+ const processedMessageStore = processMessageStoreOperations(\n+ messageStoreAfterReassignment,\n+ newMessageOps,\n+ );\n+ invariant(\n+ !isDev ||\n+ _isEqual(processedMessageStore.messages)(mergedMessageStore.messages),\n+ `${actionType}: processed.messages should be equal to mergedMessageStore.messages`,\n+ );\n+\n+ return {\n+ messageStoreOperations: [...reassignMessagesOps, ...newMessageOps],\n+ messageStore: mergedMessageStore,\n+ };\n}\ntype FilterByNewThreadInfosResult = {\n@@ -656,13 +684,15 @@ function reduceMessageStore(\naction.payload.updatesResult.newUpdates,\naction.payload.messagesResult.truncationStatuses,\n);\n- return mergeNewMessages(\n+\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\nmessagesResult.rawMessageInfos,\nmessagesResult.truncationStatuses,\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (action.type === processUpdatesActionType) {\nif (action.payload.updatesResult.newUpdates.length === 0) {\nreturn messageStore;\n@@ -673,7 +703,7 @@ function reduceMessageStore(\naction.payload.updatesResult.newUpdates,\n);\n- const newMessageStore = mergeNewMessages(\n+ const { messageStore: newMessageStore } = mergeNewMessages(\nmessageStore,\nmessagesResult.rawMessageInfos,\nmessagesResult.truncationStatuses,\n@@ -691,24 +721,26 @@ function reduceMessageStore(\naction.type === processMessagesActionType\n) {\nconst { messagesResult } = action.payload;\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\nmessagesResult.rawMessageInfos,\nmessagesResult.truncationStatuses,\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (\naction.type === fetchMessagesBeforeCursorActionTypes.success ||\naction.type === fetchMostRecentMessagesActionTypes.success\n) {\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\naction.payload.rawMessageInfos,\n{ [action.payload.threadID]: action.payload.truncationStatus },\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (\naction.type === logOutActionTypes.success ||\naction.type === deleteAccountActionTypes.success ||\n@@ -739,81 +771,88 @@ function reduceMessageStore(\naction.payload.newMessageInfos,\naction.payload.updatesResult.newUpdates,\n);\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\nmessagesResult.rawMessageInfos,\nmessagesResult.truncationStatuses,\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (action.type === registerActionTypes.success) {\nconst truncationStatuses = {};\nfor (const messageInfo of action.payload.rawMessageInfos) {\ntruncationStatuses[messageInfo.threadID] =\nmessageTruncationStatus.EXHAUSTIVE;\n}\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\naction.payload.rawMessageInfos,\ntruncationStatuses,\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (\naction.type === changeThreadSettingsActionTypes.success ||\naction.type === removeUsersFromThreadActionTypes.success ||\naction.type === changeThreadMemberRolesActionTypes.success\n) {\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\naction.payload.newMessageInfos,\n{ [action.payload.threadID]: messageTruncationStatus.UNCHANGED },\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (\naction.type === createEntryActionTypes.success ||\naction.type === saveEntryActionTypes.success\n) {\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\naction.payload.newMessageInfos,\n{ [action.payload.threadID]: messageTruncationStatus.UNCHANGED },\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (action.type === deleteEntryActionTypes.success) {\nconst payload = action.payload;\nif (payload) {\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\npayload.newMessageInfos,\n{ [payload.threadID]: messageTruncationStatus.UNCHANGED },\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n}\n} else if (action.type === restoreEntryActionTypes.success) {\nconst { threadID } = action.payload;\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\naction.payload.newMessageInfos,\n{ [threadID]: messageTruncationStatus.UNCHANGED },\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (action.type === joinThreadActionTypes.success) {\nconst messagesResult = mergeUpdatesWithMessageInfos(\naction.payload.rawMessageInfos,\naction.payload.updatesResult.newUpdates,\n);\n- return mergeNewMessages(\n+ const { messageStore: mergedMessageStore } = mergeNewMessages(\nmessageStore,\nmessagesResult.rawMessageInfos,\nmessagesResult.truncationStatuses,\nnewThreadInfos,\naction.type,\n);\n+ return mergedMessageStore;\n} else if (\naction.type === sendTextMessageActionTypes.started ||\naction.type === sendMultimediaMessageActionTypes.started\n@@ -954,7 +993,7 @@ function reduceMessageStore(\ntruncationStatuses[messageInfo.threadID] =\nmessageTruncationStatus.UNCHANGED;\n}\n- const newMessageStore = mergeNewMessages(\n+ const { messageStore: newMessageStore } = mergeNewMessages(\nmessageStore,\naction.payload.rawMessageInfos,\ntruncationStatuses,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Modify `mergeNewMessages` return type to include `messageStoreOperations` Summary: na Test Plan: in progress Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1854
129,184
06.08.2021 18:01:40
14,400
12209aad972999481f0ef2e4126df9514f8102a7
[lib] Introduce `messageStoreOperation` for `rehydrateActionType` in `reduceMessageStore` Summary: na Test Plan: na Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -1176,6 +1176,7 @@ function reduceMessageStore(\nconst newMessages = {};\nlet newThreads = threads,\nnewLocal = local;\n+ const messageIDsToBeRemoved = [];\nfor (const id in messages) {\nconst message = messages[id];\nif (\n@@ -1186,6 +1187,7 @@ function reduceMessageStore(\nnewMessages[id] = message;\ncontinue;\n}\n+ messageIDsToBeRemoved.push(id);\nconst { threadID } = message;\nnewThreads = {\n...newThreads,\n@@ -1204,12 +1206,31 @@ function reduceMessageStore(\nif (newThreads === threads) {\nreturn messageStore;\n}\n- return {\n+ const newMessageStore = {\n...messageStore,\nmessages: newMessages,\nthreads: newThreads,\nlocal: newLocal,\n};\n+\n+ const messageStoreOperation: MessageStoreOperation[] = [\n+ {\n+ type: 'remove',\n+ payload: { ids: messageIDsToBeRemoved },\n+ },\n+ ];\n+ const processedMessageStore = processMessageStoreOperations(\n+ messageStore,\n+ messageStoreOperation,\n+ );\n+ invariant(\n+ !isDev ||\n+ _isEqual(processedMessageStore.messages)(newMessageStore.messages),\n+ 'processedMessageStore.messages should be equal to' +\n+ 'newMessageStore.messages',\n+ );\n+\n+ return newMessageStore;\n} else if (action.type === processServerRequestsActionType) {\nconst {\nmessageStore: messageStoreAfterReassignment,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Introduce `messageStoreOperation` for `rehydrateActionType` in `reduceMessageStore` Summary: na Test Plan: na Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1860
129,184
06.08.2021 18:12:37
14,400
ff651c50e0db79dec7b2b9b6a5dca650f0a69d4c
[lib] Introduce `RekeyMessageOperation` Summary: Introduce a `RekeyMessageOperation` op to handle the `send[Text/Multimedia]MessageActionTypes.success` action We could just compose the `remove` and `replace` operations to achieve the same thing, but I think this API is cleaner Test Plan: na Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/types/message-types.js", "new_path": "lib/types/message-types.js", "diff": "@@ -338,9 +338,15 @@ export type ReplaceMessageOperation = {\n+payload: { +id: string, +messageInfo: RawMessageInfo },\n};\n+export type RekeyMessageOperation = {\n+ +type: 'rekey',\n+ +payload: { +from: string, +to: string },\n+};\n+\nexport type MessageStoreOperation =\n| RemoveMessageOperation\n- | ReplaceMessageOperation;\n+ | ReplaceMessageOperation\n+ | RekeyMessageOperation;\nexport const messageTruncationStatus = Object.freeze({\n// EXHAUSTIVE means we've reached the start of the thread. Either the result\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Introduce `RekeyMessageOperation` Summary: Introduce a `RekeyMessageOperation` op to handle the `send[Text/Multimedia]MessageActionTypes.success` action We could just compose the `remove` and `replace` operations to achieve the same thing, but I think this API is cleaner Test Plan: na Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1861
129,190
03.08.2021 16:09:38
-7,200
158496baa8984247b0177364ce28d544b8b4f703
[native] Secure store - add mutual code Summary: This is a mutual code for both platforms and methods of this class should be implemented separately for Android and iOS Test Plan: it should just build Reviewers: palys-swm, ashoat Subscribers: ashoat, palys-swm, Adrian, atul
[ { "change_type": "ADD", "old_path": null, "new_path": "native/cpp/CommonCpp/Tools/CommSecureStore.h", "diff": "+#pragma once\n+\n+#include <folly/Optional.h>\n+\n+#include <string>\n+\n+namespace comm {\n+\n+class CommSecureStore {\n+public:\n+ void set(const std::string key, const std::string value) const;\n+ folly::Optional<std::string> get(const std::string key) const;\n+};\n+\n+} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -27,6 +27,8 @@ PODS:\n- EXPermissions (8.1.0):\n- UMCore\n- UMPermissionsInterface\n+ - EXSecureStore (10.2.0):\n+ - UMCore\n- EXSplashScreen (0.3.1):\n- UMCore\n- FBLazyVector (0.64.2)\n@@ -530,6 +532,7 @@ DEPENDENCIES:\n- EXImageManipulator (from `../../node_modules/expo-image-manipulator/ios`)\n- EXMediaLibrary (from `../../node_modules/expo-media-library/ios`)\n- EXPermissions (from `../../node_modules/expo-permissions/ios`)\n+ - EXSecureStore (from `../../node_modules/expo-secure-store/ios`)\n- EXSplashScreen (from `../../node_modules/expo-splash-screen/ios`)\n- FBLazyVector (from `../../node_modules/react-native/Libraries/FBLazyVector`)\n- FBReactNativeSpec (from `../../node_modules/react-native/React/FBReactNativeSpec`)\n@@ -668,6 +671,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/expo-media-library/ios\"\nEXPermissions:\n:path: \"../../node_modules/expo-permissions/ios\"\n+ EXSecureStore:\n+ :path: \"../../node_modules/expo-secure-store/ios\"\nEXSplashScreen:\n:path: \"../../node_modules/expo-splash-screen/ios\"\nFBLazyVector:\n@@ -825,6 +830,7 @@ SPEC CHECKSUMS:\nEXImageManipulator: 77756def08b3f2bc2a0470c657fbd0d94f381fa4\nEXMediaLibrary: 580c097a85f9253deaaf7aaa75a8a2e692e9d8b9\nEXPermissions: 24b97f734ce9172d245a5be38ad9ccfcb6135964\n+ EXSecureStore: 1aa80d49a3a101418bbd2675e2a0d32dceea10c2\nEXSplashScreen: c4ed5d39cd5dbc1329f8dec720e280276bafa28b\nFBLazyVector: e686045572151edef46010a6f819ade377dfeb4b\nFBReactNativeSpec: 00d3c44d268b294f240a43ff003e918ff9f510e2\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"expo-haptics\": \"^10.1.0\",\n\"expo-image-manipulator\": \"^8.4.0\",\n\"expo-media-library\": \"^10.0.0\",\n+ \"expo-secure-store\": \"^10.2.0\",\n\"expo-splash-screen\": \"^0.3.1\",\n\"find-root\": \"^1.1.0\",\n\"invariant\": \"^2.2.4\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -7653,6 +7653,11 @@ expo-permissions@~8.1.0:\nresolved \"https://registry.yarnpkg.com/expo-permissions/-/expo-permissions-8.1.0.tgz#a7f2ee91ba76ce3a467e7b10adaa9ca5201b226f\"\nintegrity sha512-QBHD+1J9+sGFnhoEGzMRchPweeEE0OJ9ehG/0l1BMRBA7qsLS9vRC1FTJ55NwjI0Kr4RTha9r6ZX1kZHT09f/w==\n+expo-secure-store@^10.2.0:\n+ version \"10.2.0\"\n+ resolved \"https://registry.yarnpkg.com/expo-secure-store/-/expo-secure-store-10.2.0.tgz#561dfea4d6b4d05a738643d80a15403ebe0e515d\"\n+ integrity sha512-yNahMY3qzEotAYdsE02ps4yGfDay2twasHfsI/7gJB9SrwXYFx5bJuCDk8uTo8jsm6psvDjO+9VMM2DSPHik2A==\n+\nexpo-splash-screen@^0.3.1:\nversion \"0.3.1\"\nresolved \"https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.3.1.tgz#4dd79d9d1ab8135281f7cc5889a68e3003223f37\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Secure store - add mutual code Summary: This is a mutual code for both platforms and methods of this class should be implemented separately for Android and iOS Test Plan: it should just build Reviewers: palys-swm, ashoat Reviewed By: palys-swm, ashoat Subscribers: ashoat, palys-swm, Adrian, atul Differential Revision: https://phabricator.ashoat.com/D1820
129,184
08.08.2021 17:58:20
14,400
01e944ad9cf55ae474d522ef001e87bb0077c712
[lib] Introduce `processedMessageStore` invariant for `processServerRequestsAction` in `reduceMessageStore` Summary: na Test Plan: na Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -1233,8 +1233,24 @@ function reduceMessageStore(\nreturn newMessageStore;\n} else if (action.type === processServerRequestsActionType) {\nconst {\n+ messageStoreOperations: reassignMessagesOps,\nmessageStore: messageStoreAfterReassignment,\n} = reassignMessagesToRealizedThreads(messageStore, newThreadInfos);\n+\n+ const processedMessageStore = processMessageStoreOperations(\n+ messageStore,\n+ reassignMessagesOps,\n+ );\n+\n+ invariant(\n+ !isDev ||\n+ _isEqual(messageStoreAfterReassignment.messages)(\n+ processedMessageStore.messages,\n+ ),\n+ 'processedMessageStore.messages should be equal to' +\n+ ' messageStoreAfterReassignment.messages',\n+ );\n+\nreturn messageStoreAfterReassignment;\n}\nreturn messageStore;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Introduce `processedMessageStore` invariant for `processServerRequestsAction` in `reduceMessageStore` Summary: na Test Plan: na Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1868
129,184
08.08.2021 22:30:49
14,400
f010847fab894afd4b56a71f1d699125cd236178
[lib] Handle `RekeyMessageOperation`s in `processMessageStoreOperations` Summary: na Test Plan: todo Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -638,6 +638,10 @@ function processMessageStoreOperations(\nfor (const id of operation.payload.ids) {\ndelete processedMessages[id];\n}\n+ } else if (operation.type === 'rekey') {\n+ processedMessages[operation.payload.to] =\n+ processedMessages[operation.payload.from];\n+ delete processedMessages[operation.payload.from];\n}\n}\nreturn { ...messageStore, messages: processedMessages };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Handle `RekeyMessageOperation`s in `processMessageStoreOperations` Summary: na Test Plan: todo Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1869
129,184
08.08.2021 22:53:50
14,400
95fa202b1e679269d8931dce4d28964411bdae90
[lib] Introduce `messageStoreOperation` for `sendTextMessageActionTypes.success` action in `reduceMessageStore` Summary: na Test Plan: invariant Reviewers: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "lib/reducers/message-reducer.js", "new_path": "lib/reducers/message-reducer.js", "diff": "@@ -973,6 +973,7 @@ function reduceMessageStore(\nconst replaceMessageKey = (messageKey: string) =>\nmessageKey === payload.localID ? payload.serverID : messageKey;\nlet newMessages;\n+ const messageStoreOperations = [];\nif (messageStore.messages[payload.serverID]) {\n// If somehow the serverID got in there already, we'll just update the\n// serverID message and scrub the localID one\n@@ -982,20 +983,34 @@ function reduceMessageStore(\n!messageInfo.id &&\nmessageInfo.localID === payload.localID,\n)(messageStore.messages);\n+ messageStoreOperations.push({\n+ type: 'remove',\n+ payload: { ids: [payload.localID] },\n+ });\n} else if (messageStore.messages[payload.localID]) {\n// The normal case, the localID message gets replaced by the serverID one\nnewMessages = _mapKeys(replaceMessageKey)(messageStore.messages);\n+ messageStoreOperations.push({\n+ type: 'rekey',\n+ payload: { from: payload.localID, to: payload.serverID },\n+ });\n} else {\n// Well this is weird, we probably got deauthorized between when the\n// action was dispatched and when we ran this reducer...\nreturn messageStore;\n}\n- newMessages[payload.serverID] = {\n+\n+ const newMessage = {\n...newMessages[payload.serverID],\nid: payload.serverID,\nlocalID: payload.localID,\ntime: payload.time,\n};\n+ newMessages[payload.serverID] = newMessage;\n+ messageStoreOperations.push({\n+ type: 'replace',\n+ payload: { id: payload.serverID, messageInfo: newMessage },\n+ });\nconst threadID = payload.threadID;\nconst newMessageIDs = _flow(\n_uniq,\n@@ -1008,7 +1023,7 @@ function reduceMessageStore(\nconst local = _pickBy(\n(localInfo: LocalMessageInfo, key: string) => key !== payload.localID,\n)(messageStore.local);\n- return {\n+ const updatedMessageStore = {\nmessages: newMessages,\nthreads: {\n...messageStore.threads,\n@@ -1020,6 +1035,20 @@ function reduceMessageStore(\nlocal,\ncurrentAsOf,\n};\n+\n+ const processedMessageStore = processMessageStoreOperations(\n+ messageStore,\n+ messageStoreOperations,\n+ );\n+\n+ invariant(\n+ !isDev ||\n+ _isEqual(processedMessageStore.messages)(updatedMessageStore.messages),\n+ 'processedMessageStore.messages should be equal to' +\n+ ' updatedMessageStore.messages',\n+ );\n+\n+ return updatedMessageStore;\n} else if (action.type === saveMessagesActionType) {\nconst truncationStatuses = {};\nfor (const messageInfo of action.payload.rawMessageInfos) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Introduce `messageStoreOperation` for `sendTextMessageActionTypes.success` action in `reduceMessageStore` Summary: na Test Plan: invariant Reviewers: ashoat Reviewed By: ashoat Subscribers: palys-swm, Adrian, karol-bisztyga Differential Revision: https://phabricator.ashoat.com/D1870