-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix inbox from briefly displaying when creating WS from selector and … #52092
fix inbox from briefly displaying when creating WS from selector and … #52092
Conversation
@dominictb 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] |
Hi @dominictb, @puneetlath We have an issue after updating the pull request for this ticket, which is:
Can I ask if we are fixing this issue in this pull request or if a new ticket will be created to address it? Note: I will set this pull request to WIP until my question is resolved |
Interesting? What's the reason for that bug? |
@puneetlath I feel this issue comes from the lazy load of FlashList. I say this because I logged the data, which is updated, but it doesn't render on the list. I will investigate further |
Ok, can you look into it? If it's a straightforward change, we can include it hear (and increase the pay). If it's more involved, we can handle separately. |
@puneetlath Yes, I am investigating this and will provide you with more details once I find them. |
…efly-displayed-on-ws-create
…ion until creation is complete
@puneetlath , @dominictb I've updated the fix for the issue mentioned above. The RCA: When we tap the plus icon, the orderedReportIDs are updated with the new workspace we created. At that moment, the Flashlist also updates because the list data has changed. However, we then navigate to the workspace initial screen, so FlashList unmounts, and the LayoutManager inside FlashList sets the height to 0. When we return from the workspace, the data hasn’t changed because it was updated previously, so the height remains 0, and this causes the issue. This issue happens on mWeb and web. On web, the behavior can appear random, as it depends on the workspace created. If the created workspace has an admin room in the LHN, the issue doesn’t occur because new data is added, including the new reportId of the admin room, causing FlashList to re-render. The solutions If you have any questions, let me know. I can explain further, as I have a deep understanding of why this happened. |
…efly-displayed-on-ws-create
@puneetlath @dominictb Can you check my comment? |
Thanks. Reviewing now. |
@huult The bug you are talking about is: LHN just show only 1 item? resize.mp4If so can you add the code reference to explain the RCA. For example
I can't open the If the FlashList unmounts, how the component inside it sets the height to 0 (since it unmounts too) |
…efly-displayed-on-ws-create
Yes
I will provide you with more details tomorrow. Screen.Recording.2024-11-13.at.22.16.48.mp4 |
@huult any updates? |
@dominictb Please wait for me for 5 more hours |
@dominictb I am busy at this time. I will give it as soon as possible, but no later than tomorrow. |
…efly-displayed-on-ws-create
When tapping the plus icon, the data in FlashList changes, triggering the componentDidUpdate function in node_modules/recyclerlistview/dist/reactnative/core/RecyclerListView.js. Within this function, _checkAndChangeLayouts recalculates the layout (using relayoutFromIndex) when the data changes. That is the logic of FlashList. Screen.Recording.2024-11-15.at.10.24.47.movBut when Screen.Recording.2024-11-15.at.10.42.42.movAnd when we go back to the home screen, the height value is still 0. Since the data hasn’t changed, componentDidUpdate is not triggered to re-layout, and this issue occurs. My suggested solution is to delay navigation to the workspace until the FlashList re-layout is complete. That’s why I used //src/libs/actions/App.ts#L380
InteractionManager.runAfterInteractions(() => {
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID, backTo));
}); |
Reviewing |
@dominictb @puneetlath #52651 is the same RCA we know, and I have found the RCA and have a fix. |
@dominictb You are correct, if we removed the plus icon, this issue would no longer be valid, and the issue I mentioned would still not be reproducible |
@dominictb I think this issue still exists. This is because we have the Get Started case, where if we don't have any workspace, we can create a workspace in the same way. I will double check |
@dominictb When we remove the plus icon, we still encounter the 'get started' case for when there is no workspace. So I think we are able to proceed with this pull request to fix this case. This issue I mentioned: Screen.Recording.2024-11-19.at.16.11.14.movI have already updated the pull request to fix the issue with the 'Get started' case. Can you check it again? Thank you! |
@@ -378,7 +378,9 @@ function createWorkspaceWithPolicyDraftAndNavigateToIt(policyOwnerEmail = '', po | |||
Navigation.goBack(); | |||
} | |||
savePolicyDraftByNewWorkspace(policyID, policyName, policyOwnerEmail, makeMeAdmin); | |||
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID, backTo)); | |||
InteractionManager.runAfterInteractions(() => { |
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 understand the RCA but using runAfterInteractions
is not a good idea to me (same as using setTimeout). This bug is also not related to the original one so we can ignore it for now and create another issue for that.
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.
yes
Hi! Just curious for a summary on where we're at with this PR. |
As discussed in the ticket, I will close this pull request |
Details
Fixed Issues
$ #50850
PROPOSAL: #50850 (comment)
Tests
Same QA step
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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)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
Screen.Recording.2024-11-09.at.17.43.58.mp4
Android: mWeb Chrome
Screen.Recording.2024-11-09.at.17.44.37.mp4
iOS: Native
Screen.Recording.2024-11-09.at.17.45.45.mp4
iOS: mWeb Safari
Screen.Recording.2024-11-09.at.17.46.52.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-11-09.at.17.41.03.mp4
MacOS: Desktop
Screen.Recording.2024-11-09.at.17.43.01.mp4