-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No QA] Fix CREATE
mutations being dropped by merging transactions
#53313
[No QA] Fix CREATE
mutations being dropped by merging transactions
#53313
Conversation
@DylanDylann 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] |
Start on reviewing |
@j-piasecki Do we have any related reference to this change already known on react-native |
Not that I'm aware of. There's an issue I've opened that may be used to track progress there - facebook/react-native#47960 - but the current implementation of the fix doesn't work yet. |
Give me more time to deep dive into this change |
🚧 @mountiny has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeWhatsApp.Video.2024-12-14.at.18.38.00.mp4Android: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a lot of context on this but based on this explanation it does make sense. @mountiny do you think you could check this as well if you have a chance?
@shubham1206agra i think you mentioned you have been able to reproduce this crash before, now on this PR you are not able to, right? if there are no tests/qa can we add a noQA to the title if there is no clear way to test this? @j-piasecki can you please merge main too? |
Yes |
There already is |
@j-piasecki apologies, I was on mobile and midread it, all good. @srikarparsi feel free to merge this PR |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.78-0 🚀
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.78-0 🚀
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.78-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.78-0 🚀
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.78-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.78-0 🚀
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.78-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.78-6 🚀
|
Explanation of Change
The changes between different versions of the UI are run as transactions by React Native. When there is more than one transaction in the same cycle (for example by using
useLayoutEffect
) those transactions are merged (merging simply adds mutations from one transaction to the other) so that they are executed atomically. To optimize sending the data from the C++ layer to the native mounting layer in Java, the mutations are reordered so that the mutations of the same type are clustered together. There's a predefined order in which mutations will be executed, andDELETE
operations are executed last. This allows the following to happen:Unable to find viewState for tag X
exceptionThere is work happening to fix this upstream in React Native but I think it should be patched temporarily in the App. This PR adds a patch that will check whether the two transactions would result in the above case by comparing the views deleted by the first and created by the second. If those results are in the wrong state, the merge will not happen. The downside is the possibility of showing the intermediate UI state as the two transactions may get executed separately. This will only happen in places where the crash would have happened which makes me believe it's an acceptable tradeoff.
The above doesn't affect iOS due to differences in mounting implementation.
Fixed Issues
$ #50463
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop