From 16ca5d3e974bbe1c80050d9f3496d428781f66ae Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Wed, 27 Sep 2023 18:54:33 +0300 Subject: [PATCH] MM-54535 Fixed hang when using the magic keyboard on iPadOS 17 (#7555) * MM-53989 Upgrade to Node 18 and NPM 9 and match platform versions * fix iPad OS 17 magic keyboard loop * add engine-strict=true to npmrc * use node version from nvmrc in action --- .github/actions/prepare-node-deps/action.yaml | 2 +- .node-version | 2 +- .npmrc | 1 + .nvmrc | 2 +- .solidarity | 14 ------- package-lock.json | 4 ++ package.json | 4 ++ ...-native-keyboard-tracking-view+5.7.0.patch | 37 +++++++++++++++++++ 8 files changed, 49 insertions(+), 17 deletions(-) diff --git a/.github/actions/prepare-node-deps/action.yaml b/.github/actions/prepare-node-deps/action.yaml index 22967d7d6..bb621a052 100644 --- a/.github/actions/prepare-node-deps/action.yaml +++ b/.github/actions/prepare-node-deps/action.yaml @@ -7,7 +7,7 @@ runs: - name: ci/setup-node uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: - node-version: "${{ env.NODE_VERSION }}" + node-version-file: ".nvmrc" cache: "npm" cache-dependency-path: package-lock.json diff --git a/.node-version b/.node-version index fb67e3d51..aacb51810 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18.7.0 +18.17 diff --git a/.npmrc b/.npmrc index cffe8cdef..145d3fa25 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ save-exact=true +engine-strict=true diff --git a/.nvmrc b/.nvmrc index fb67e3d51..aacb51810 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.7.0 +18.17 diff --git a/.solidarity b/.solidarity index b713705ec..01799368b 100644 --- a/.solidarity +++ b/.solidarity @@ -4,20 +4,6 @@ "output" : "moderate" }, "requirements": { - "Node": [ - { - "rule": "cli", - "binary": "node", - "semver": ">=16.0.0", - "error": "install node using nvm https://github.com/nvm-sh/nvm#installing-and-updating" - }, - { - "rule": "cli", - "binary": "npm", - "semver": ">=7.24.0 <9.0.0", - "error": "install npm 8.5.5 `npm i -g npm@8.5.5" - } - ], "Android": [ { "rule": "cli", diff --git a/package-lock.json b/package-lock.json index 5358494f3..a7a611d00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -177,6 +177,10 @@ "underscore": "1.13.6", "util": "0.12.5", "uuid": "9.0.0" + }, + "engines": { + "node": "^18.10.0", + "npm": "^9.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index f6b6aaae7..95aa1c2ac 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,10 @@ "author": "Mattermost, Inc.", "license": "Apache 2.0", "private": true, + "engines": { + "node": "^18.10.0", + "npm": "^9.0.0" + }, "dependencies": { "@formatjs/intl-datetimeformat": "6.10.0", "@formatjs/intl-getcanonicallocales": "2.2.1", diff --git a/patches/react-native-keyboard-tracking-view+5.7.0.patch b/patches/react-native-keyboard-tracking-view+5.7.0.patch index 26b55773d..c0b9edcc3 100644 --- a/patches/react-native-keyboard-tracking-view+5.7.0.patch +++ b/patches/react-native-keyboard-tracking-view+5.7.0.patch @@ -413,6 +413,43 @@ index 1333a10..b908006 100644 RCT_EXPORT_METHOD(getNativeProps:(nonnull NSNumber *)reactTag resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { [self.bridge.uiManager addUIBlock: +diff --git a/node_modules/react-native-keyboard-tracking-view/lib/ObservingInputAccessoryView.m b/node_modules/react-native-keyboard-tracking-view/lib/ObservingInputAccessoryView.m +index e472679..4a2204b 100644 +--- a/node_modules/react-native-keyboard-tracking-view/lib/ObservingInputAccessoryView.m ++++ b/node_modules/react-native-keyboard-tracking-view/lib/ObservingInputAccessoryView.m +@@ -115,21 +115,25 @@ + + - (void)_keyboardWillShowNotification:(NSNotification*)notification + { +- _keyboardState = KeyboardStateWillShow; ++ if (_keyboardState != KeyboardStateShown) { ++ _keyboardState = KeyboardStateWillShow; + +- [self invalidateIntrinsicContentSize]; ++ [self invalidateIntrinsicContentSize]; + +- if([_delegate respondsToSelector:@selector(observingInputAccessoryViewKeyboardWillAppear:keyboardDelta:)]) +- { +- [_delegate observingInputAccessoryViewKeyboardWillAppear:self keyboardDelta:_keyboardHeight - _previousKeyboardHeight]; ++ if([_delegate respondsToSelector:@selector(observingInputAccessoryViewKeyboardWillAppear:keyboardDelta:)]) ++ { ++ [_delegate observingInputAccessoryViewKeyboardWillAppear:self keyboardDelta:_keyboardHeight - _previousKeyboardHeight]; ++ } + } + } + + - (void)_keyboardDidShowNotification:(NSNotification*)notification + { +- _keyboardState = KeyboardStateShown; ++ if (_keyboardState != KeyboardStateShown) { ++ _keyboardState = KeyboardStateShown; + +- [self invalidateIntrinsicContentSize]; ++ [self invalidateIntrinsicContentSize]; ++ } + } + + - (void)_keyboardWillHideNotification:(NSNotification*)notification diff --git a/node_modules/react-native-keyboard-tracking-view/src/KeyboardTrackingView.android.js b/node_modules/react-native-keyboard-tracking-view/src/KeyboardTrackingView.android.js index af15edf..20b6ab6 100644 --- a/node_modules/react-native-keyboard-tracking-view/src/KeyboardTrackingView.android.js