Conversation
faaf2ba to
39052d4
Compare
|
@dangrous can we prepare a build based on this PR and ask QA to test if these changes actually fix the reported problem and don't introduce new problems? Slightly afraid, that we are touching |
|
sure! Let me get that build started |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
Do you mind double checking that that looks good @kirillzyusko and then I can send over to QA? |
|
@dangrous I tested and for me it worked well in release variant 👀 I also think that potentially it may fix other issues such as https://github.com/Expensify/Expensify/issues/519304 |
|
Just requested qa's help! https://expensify.slack.com/archives/C9YU7BX5M/p1726092553187509 |
|
Sounds like this passed QA, with one remaining known issue. Will get the details shortly! |
@dangrous does it mean that I can proceed with this PR further, clean it up and prepare for a review? 👀 |
|
Yeah I think go ahead! I haven't heard back yet from QA on which issue still exists (I'm assuming it's not #44600 which is the only one that would be concerning) but I will ping them again. |
|
@aimane-chnaif 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] |
|
@aimane-chnaif @dangrous this PR is ready for a review 🎉 |
|
Please merge main. 1.7k commits are behind |
| "react-native": "0.75.2", | ||
| "react-native-android-location-enabler": "^2.0.1", | ||
| "react-native-blob-util": "0.19.4", | ||
| "react-native-bundle-splitter": "^3.0.1", |
There was a problem hiding this comment.
I think this should follow the New Library Process
91319c5 to
13ff0d0
Compare
Done 🙌 |
|
On hold for #49519 |
|
Hey @kirillzyusko finally got the response from QA - looks like the PR still reproduces these issues: Any chance you could take a look at those? |
|
@dangrous so we want to fix all of these issues in a single PR? Or do you want me to look and discover a root problem for these bugs? |
I can confirm this is still reproducible in this branch. I can not reproduce it from this branch 🤷♂️ |
|
Okay so one of those was closed and QA suggested this PR would reopen it. That one we should definitely make sure we don't reintroduce with this. The other one was open, I was going to say we don't have to handle it here BUT they just closed it in favor of this PR haha. It sounds like it might not be reproducible anymore. So TLDR - let's see if either of those occur with this PR, and we only need to fix if they still do. |
Well, I can rebase this PR to latest main because right now it's ~1000 commits behind. I couldn't reproduce the problem, but I hardly believe this PR can introduce such behavior 😅 P. S. I just re-tested this issue on updated branch and I can not reproduce it 🤷♂️ @dangrous maybe you can re-test it as well to confirm that it's not reproducible? |
13ff0d0 to
1f2db18
Compare
|
Confirmed, I don't see that happening either. I think we're okay? |
|
As for https://github.com/Expensify/Expensify/issues/519304 - you said you could reproduce that one here? Let's see if we can fix it too, since even if we don't show the inbox (this issue) we probably should make sure we show the correct (non-expired) page, too. Does that make sense? |
|
@kirillzyusko any update here? |
|
@garrettmknight thanks for reminder! The thread was lost somehow 🙈
Yeah, I can reproduce and you it totally makes sense what you are saying. But do I correctly udnderstand that you want to fix it in this PR? |
|
It looks actually like it's being fixed separately so yeah, you can ignore it here! |
Cool! So we can review this PR then, right? 👀 |
|
Yep! though we're waiting on approval of that library right? |
Oh, yeah, right! |
|
Closing PR because the behavior was re-defined: #44600 (comment) |
Details
The fix consist from two parts:
Let's consider each part in more details.
1️⃣ preload the component in advance to be able to mount it synchronously on a demand
If we mount the component and the component is lazy and haven't been loaded yet, then when we switch navigator we remove old navigator, but a new one navigator doesn't have routes yet, so
react-navigationclears a state, and when new routes are attached then a default route will be selected, because previous state was lost.So we need to mount the screen/navigator synchronously.
2️⃣ clean up the state in asynchronous way if it's a real component unmount
The synchronous clean up was added here - #42592
The key thing is that now
unmountis getting fired two times. If we have an asyncronous removal, then navigation just stops working (because we perform a navigation and then instantly run unmount - unmount fires asynchronously and removes just created new state).To fix this problem I patched
react-navigationand addeduseFullyMountedRefhook. It's returningref.current=falseif component is not fully mounted (i. e. unmount is about to be fired) and will updateref.current=truewhen component finished it's mounting.This solution is not perfect, but currently
react-navigation@6is not fully compatible withStrictMode, so we have to patch it. Most likely withreact-navigation@7this patch will not be needed, becausereact-navigation@7supportingStrictMode.Fixed Issues
$ #44600
PROPOSAL: N/A
Tests
Warning
Please, test a release version locally.
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Untitled.mov
MacOS: Desktop