Updated code to remove dependency on IS_LOADING_POLICY_DATA for Welcome.js#11627
Conversation
b1a0ee9 to
fc1669c
Compare
luacmartins
left a comment
There was a problem hiding this comment.
We are intentionally removing the IS_LOADING_POLICY_DATA key. Instead of adding it back, I'd suggest that we remove the Welcome event's dependency on it.
bondydaa
left a comment
There was a problem hiding this comment.
Looks like the only other spots we use that Onyx key is here
App/src/libs/actions/Policy.js
Lines 183 to 203 in ec7d84b
| }, | ||
| ], |
There was a problem hiding this comment.
strange I thought we'd prefer what was there before (}]) did the linter complain about this?
There was a problem hiding this comment.
+1 I think the other way reads better. Same for the others.
luacmartins
left a comment
There was a problem hiding this comment.
I agree with Bondy's comments. Let's revert the style changes in actions/App and remove this code and this Onyx key
| }, | ||
| ], |
There was a problem hiding this comment.
+1 I think the other way reads better. Same for the others.
luacmartins
left a comment
There was a problem hiding this comment.
Looking good! While reviewing this, I noticed that we might have another bug (not introduced in this PR)
This code is supposed to load all policies, but it actually loads all reports. So the first part of this conditional will probably always be true and admins of workspaces would also see the welcome action.
We can fix that in this PR too!
Great catch, since policy data are not loaded this makes sense. |
There was a problem hiding this comment.
@techievivek I had to merge main to be able to see the policy expense chats. The solution seem to work well on web, desktop and mWeb Chrome, but it did not work on android, iOS or mWeb safari.
I see that you had videos with the solution working, so I'm wondering if it's just me holding something wrong. @bondydaa could you try to test this solution in iOS/android?
web.mov
desktop.mov
chrome.mov
android.mov
ios.mov
safari.mov
|
That's odd, let me try testing it once again and probably adding some log statements to make sure logic is being hit. |
|
In the logs, I could see that we were trying to navigate to the correct expense chat report. It might just be some RN navigation quirk. |
|
I struggled with the DEV environment setup yesterday, so couldn't look into it. I will test it today. |
|
I tested this locally and experienced the same thing that @luacmartins experienced. I wasn't able to test this further because of the In the logs, it does show that we will be navigation to the workspace chat but it just freezes. |
|
@techievivek this is some quirk with react-navigation. I'd see if anybody in engineeering-chat has some ideas on how to fix this. I had a similar issue not too long ago |
|
@techievivek since this is a react navigation issue, I think we should merge this to partially fix the problem and then open another issue to investigate the RN nav issue. Could you please update your branch with main? I'll review it again and merge this PR then. |
|
Alright, I have merged with main now. |
|
@techievivek can you update your author checklist? I think that we have a new version and that's why your PR Author checklist check is failing |
|
@luacmartins I have ticked all the options. I am not sure why it is still failing. |
|
@luacmartins, thanks for the note, I have updated the checklists. |
web.movdesktop.movchrome.movandroid.movios.movsafari.mov |
|
@techievivek I created a new issue for the react navigation quirk on iOS and android and assigned it to you. |
|
✋ 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 @luacmartins in version: 1.2.19-0 🚀
|
|
🚀 Deployed to production by @chiragsalian in version: 1.2.19-2 🚀
|
Late to the party, but I would have re-named this if we are relaying on a "report data is loading" flag to mean more than just the report data is loading. |

Details
In Welcome.js remove the usage of
IS_LOADING_POLICY_DATAbecause report and policy data are loaded together so we can just rely onIS_LOADING_REPORT_DATAto trust that both report and policy data are available.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/211216
PROPOSAL: GH_LINK_ISSUE(COMMENT)
Tests
>Invite.The workspace chat would look something like this.
./clitools.shon PROD you can click on the email.QA Steps
>Invite.The workspace chat would look something like this.
PR Review Checklist
PR Author Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)Screenshots
Web
Screen.Recording.2022-10-06.at.3.14.57.PM.mov
Mobile Web - Chrome
Screen.Recording.2022-10-10.at.2.47.55.PM.mov
Mobile Web - Safari
ios-safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov