Repository navigation
Conversation
|
|
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03a2b86963
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@marufsharifi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@David-2002065, please check the ai comment. thanks. |
|
@marufsharifi replied in the thread, i don't think it needs a change |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen_Recording_20261107_164055_Expensify.Dev.mp4Android: mWeb ChromeScreen_Recording_20261107_164541_Chrome.mp4iOS: HybridAppScreen.Recording.2026-11-07.at.5.35.33.PM.moviOS: mWeb SafariScreen.Recording.2026-11-07.at.5.24.18.PM.movMacOS: Chrome / SafariScreen.Recording.2026-11-07.at.5.44.54.PM.mov |
|
how is this looking? |
I will finalize this today. thanks. |
|
@David-2002065, could you please merge the main. thanks. |
…-touch-delete-APP-7AR
|
merged main, thanks |
| - Reason: Fixes the fatal `IllegalStateException: addViewAt: failed to insert view [N] into parent [M] at index 1` (`IndexOutOfBoundsException: index=1 count=0`) behind `APP-7AR`. When a view is deleted while it is touched, `SurfaceMountingManager.deleteView` keeps its `ViewState` and queues the tag in `viewsToDeleteAfterTouchFinishes` until the touch ends. If the same tag is mounted again before that (a view flattens and unflattens under the finger), `createView` sees the old `ViewState`, returns early and never clears the queued delete. On finger-up `sweepActiveTouchForTag` runs the stale delete and wipes the `ViewState` of the live view. The next `Insert` of that tag is skipped with `Unable to find viewState for tag`, so its parent is one child short and the next sibling's `Insert` at index 1 throws. `IntBufferBatchMountItem` is not retryable, so the app crashes. The patch makes `createView` finish the pending delete of the old `ViewState` first and then create the view normally, so the queued delete can no longer hit the new view and the `Create` applies its own props. The tag stays in `viewsWithActiveTouches`, so if the new view is deleted again while still touched, the delete is deferred as before. The old view was already detached by the `Remove` that came before its `Delete`, so dropping it does not change what is on screen. It closes one of the "delayed deletes during touches" sources listed for `+045` and `+047`. | ||
| - Upstream PR/issue: none yet. `main`, `0.87` and `0.88` have the same code (`viewsToDeleteAfterTouchFinishes` is never cleared in `createView`). The deferred delete itself comes from [react-native#44610](https://github.com/facebook/react-native/issues/44610) / [react-native#45126](https://github.com/facebook/react-native/issues/45126). | ||
| - E/App issue: https://github.com/Expensify/App/issues/104743 | ||
| - PR introducing patch: this PR. |
There was a problem hiding this comment.
Can you add a link here please
There was a problem hiding this comment.
added the link, also renamed the patch to +050 since main got its own +049 in the meantime
| - Upstream PR/issue: none yet. `main`, `0.87` and `0.88` have the same code (`viewsToDeleteAfterTouchFinishes` is never cleared in `createView`). The deferred delete itself comes from [react-native#44610](https://github.com/facebook/react-native/issues/44610) / [react-native#45126](https://github.com/facebook/react-native/issues/45126). | ||
| - E/App issue: https://github.com/Expensify/App/issues/104743 | ||
| - PR introducing patch: this PR. | ||
| - 0.86.0 migration note: drop this patch once the adopted React Native release clears the deferred delete when the tag is created again. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-11-16.at.3.02.10.PM.movScreen.Recording.2026-11-16.at.1.51.02.PM.movAndroid: mWeb ChromeScreen.Recording.2026-11-16.at.3.16.46.PM.moviOS: HybridAppScreen.Recording.2026-11-16.at.3.44.16.PM.moviOS: mWeb SafariScreen.Recording.2026-11-16.at.3.26.47.PM.movMacOS: Chrome / SafariScreen.Recording.2026-11-16.at.3.07.57.PM.mov |
|
@David-2002065, please resolve conflicts and make the requested change. |
…-touch-delete-APP-7AR # Conflicts: # patches/react-native/details.md
|
@thesahindia merged main and fixed the conflict, patch is +050 now. also added the link |
trjExpensify
left a comment
There was a problem hiding this comment.
Love knocking these down! 👍
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.41-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.41-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
When a view is deleted while it's being touched, Android
SurfaceMountingManagerkeeps itsViewStateand queues the delete until the finger is lifted. If the same tag is created again before that (the view flattens and unflattens under the finger),createViewfinds the oldViewState, returns early and leaves the queued delete in place. On finger up the queued delete runs against the live view and wipes itsViewState, so the next insert of that tag is skipped and the sibling inserted after it crashes withaddViewAt: failed to insert view [N] into parent [M] at index 1(index=1 count=0).This adds react-native patch
+050, which makescreateViewfinish the pending delete of the oldViewStatefirst and then create the view normally. The tag stays inviewsWithActiveTouches, so if the new view is deleted while still touched, the delete is deferred like before.Fixed Issues
$ #104743
PROPOSAL: #104743 (comment)
Tests
Android native:
adb shell input swipe 540 800 540 800 1500)adb shell input tap 540 800) and verify the sameOffline tests
Same as tests, the change is not network related.
QA Steps
The crash has no organic repro, so this is a regression check on Android native:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
The crash has no in-app repro, so Before/After use the repro screen from the proposal (holding the red box for about 1.5s). The last video is the real app on the patched build.
Before:
android-before.mp4
After:
android-after.mp4
Real app on the patched build:
android-app.mp4
Android: mWeb Chrome
mweb-chrome.mp4
iOS: Native
ios-native.mp4
iOS: mWeb Safari
mweb.mp4
MacOS: Chrome / Safari
web-chrome.mp4