Repository navigation
chore: drop react-native-modal InteractionManager handles via patch - #7837
diegolmello wants to merge 2 commits into
Conversation
createInteractionHandle/clearInteractionHandle are no-op stubs since RN 0.82 and InteractionManager is removed in RN 0.87, so react-native-modal would crash on open once the API is gone.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update modal lifecycle handling patches/react-native-modal+13.0.1.patch |
The modal removes interactionHandle and its show, hide, and unmount operations. It stores the subscription returned by BackHandler.addEventListener and removes it during unmount. |
Focus the code field on modal show app/containers/TwoFactor/index.tsx |
The modal’s show event calls setFocus('code'). The input no longer uses autoFocus. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- RocketChat/Rocket.Chat.ReactNative#7836: Removes app calls to
InteractionManager, a separate change involving the same React Native upgrade.
Suggested labels: type: bug
Suggested reviewers: otaviostasiak, rohit3523
Merge Risk: 
Minimal · up to 6d57a
-
No concrete merge-blocking defect is established in the changed modal or two-factor flows.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Errors were encountered while retrieving linked issues.
Errors: 1
-
- JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Android Build Available Rocket.Chat 4.78.0.110085 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNQX0zS9kp5boX_Qamxk1i7TwolgS3K8Lc8U6IKjr0UIoRKi_yeewvOW018T-AuBoB48uAFe8GabVZRjtyyv |
|
iOS Build Available Rocket.Chat 4.78.0.110086 |
Proposed changes
React Native 0.87 removes
InteractionManager, and on 0.88 any access to it throws. react-native-modal 13.0.1 callsInteractionManager.createInteractionHandle()/clearInteractionHandle()around its open and close animations, so every modal open would crash after the upgrade. The latest release (14.0.0-rc.1) still uses it, so a version bump doesn't help.This extends the existing
patches/react-native-modal+13.0.1.patchto remove those calls, theinteractionHandlefield that only guarded them, andInteractionManagerfrom the import (dist/modal.jsanddist/modal.d.ts).There is no behaviour change on the current RN 0.86.
createInteractionHandle()always returns-1, andclearInteractionHandle()does nothing with that value, because RN has ignored interaction handles since 0.82. The library never callsrunAfterInteractions, so nothing needs a replacement.The two-factor modal also stops relying on
autoFocusfor its code input. On Android the field got a cursor before the modal finished opening, but the soft keyboard stayed down until the field was tapped. The input is now focused from the modal'sonModalShow, as the join code modal already does, so the keyboard rises with the modal on both platforms.App code that still uses
InteractionManageris handled separately.Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-1825
How to test or reproduce
Open and close each modal on iOS and Android and confirm the open and close animations look the same as before:
To check the patch: after
pnpm install,grep -n InteractionManager node_modules/react-native-modal/dist/*returns nothing.Screenshots
Each clip opens and closes the modal with this patch applied (iOS simulator, Android emulator).
The two-factor and join code clips type into the field with the software keyboard open; the field, the typed text and both buttons stay above the keyboard.
Two-factor authentication
The code field is not tapped: the keyboard rises on its own as the modal opens and is fully up about 0.4 s later on both platforms. Before this change, Android kept the keyboard down until the field was tapped.
iOS
ios-twofactor-onmodalshow.mp4
Android
android-twofactor-onmodalshow.mp4
Screen lock passcode set-up
iOS
ios-change-passcode.mp4
Android
android-change-passcode.mp4
Screen locked
iOS
ios-screen-locked.mp4
Android
android-screen-locked.mp4
Room announcement
iOS
ios-banner.mp4
Android
android-banner.mp4
Join code
iOS
ios-joincode-keyboard.mp4
Android
android-joincode-keyboard.mp4
Types of changes
Checklist
Further comments
The patch was verified on an iOS simulator and an Android emulator: each of the modals above opens and closes normally, with no errors. The Jitsi auth modal also uses react-native-modal but was not exercised, since it only appears for legacy Jitsi web calls that need authentication.
Summary by CodeRabbit