fix: deleted workspace with invoices is accessible by url#49509
fix: deleted workspace with invoices is accessible by url#49509srikarparsi merged 16 commits intoExpensify:mainfrom
Conversation
|
@ishpaul777 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] |
|
We have conflicts @gijoe0295 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-11-19.at.3.56.24.AM-1.movAndroid: mWeb ChromeScreen.Recording.2024-11-19.at.4.01.54.AM.moviOS: NativeUploading Screen Recording 2024-11-19 at 1.59.02 AM-1.mov… iOS: mWeb SafariScreen.Recording.2024-11-19.at.2.04.14.AM.movMacOS: Chrome / SafariScreen.Recording.2024-11-19.at.1.19.26.AM.movMacOS: DesktopScreen.Recording.2024-11-19.at.4.13.57.AM.mov |
|
@gijoe0295 Jest test failing, can you please take a look |
|
Seems not related to this PR. Will try to merge main soon to see if it's fixed. |
| const enabledItem = protectedCollectPolicyMenuItems.find((curItem) => !prevProtectedMenuItems.some((prevItem) => curItem.routeName === prevItem.routeName)); | ||
|
|
||
| const shouldShowPolicy = useMemo(() => PolicyUtils.shouldShowPolicy(policy, isOffline, currentUserLogin), [policy, isOffline, currentUserLogin]); | ||
| const prevShouldShowPolicy = usePrevious(shouldShowPolicy); |
There was a problem hiding this comment.
why did you do it like this it seems to be not working sometimes and sometime i still see workspacepages we want something like mentioned in this proposal #49093 (comment)
There was a problem hiding this comment.
see in this vid. workspace is deleted but it still navigates to the page
Screen.Recording.2024-09-27.at.12.20.38.AM-1.mov
There was a problem hiding this comment.
but for me your solution works only sometimes, mainly on small screens it often does not work @gijoe0295
There was a problem hiding this comment.
@ishpaul777 Besides the above issue, I pushed the approach mentioned in your linked proposal.
Screen.Recording.2024-09-28.at.01.43.58.mov
There was a problem hiding this comment.
okay thanks! i'll test again in my morning, off for the day today.
There was a problem hiding this comment.
Hey @gijoe0295, thanks for reaching out. Unfortunately, I no longer work for Expensify. If you need help with this issue, you can try asking C+, who was responsible for this issue, or someone else who participated in the discussion.
There was a problem hiding this comment.
Oops thank you. Sorry for the inconvenience.
|
I am having trouble sending invoice to any user, it was working last i tested @gijoe0295 can you please check on your side, Screen.Recording.2024-09-25.at.11.51.39.PM.mov |
Worked normally for me after merging latest |
|
Bug: [IOS] Infinite loading when navigating to deleted workspace page Screen.Recording.2024-10-01.at.1.56.52.AM.mov |
|
gentle bump. @gijoe0295 ^ |
|
@gijoe0295 Its already 3 days without any response, Are you still interested finishing this PR? |
|
Sorry. Still taking a look. Will provide updates in several hours. |
|
@ishpaul777 Can you please retry or provide reproduction steps? I retried many times but still couldn't reproduce the infinite loading. |
|
i'll give this a test again on monday this was consistently reproducable for me last i checked. Steps are same as in PR description,only this different, i was not able to navigate using the link in message (it pointing to staging) so i copied dev. link) |
still reproducable, steps same as in PR test steps Untitled.mov |
|
@gijoe0295 Could you please provide an update on this asap? We need to get this done very soon. Ideally, we'd like to fix the additional bug that @ishpaul777 found in this same PR. If we're not able to get a resolution here soon, we'll need to reopen this issue for additional proposals from other contributors. |
|
@ishpaul777 I manually bumped Onyx version and retested but the infinite Hi @fabioh8010, during the implementation of this PR, we spotted a similar issue to Expensify/react-native-onyx#588 and it already happens on
I manually bumped Onyx version to Later on, I tried the solution mentioned in App/src/pages/workspace/withPolicy.tsx Line 81 in f46e545 My questions are:
It would be nice if you can help us unblock this PR. Thank you! |
|
Thanks for the report @gijoe0295, I will check this today |
|
Hey guys, I am on limited availability until Friday. will not check GH often if need me for review or anything, ping me on slack |
|
@gijoe0295 @ishpaul777 Sorry for the late here. After some try and error I was able to reproduce this issue, but I don't think my Onyx PR would solve it. My PR solved a infinite loading state issue that happened during logout process, where I agree we should investigate the issue in Onyx but if we need this PR to get merged faster, maybe it's better to disable the connection reuse ( WDYT? |
|
@fabioh8010 Thanks a lot. I'm fine with your suggestion as long as cc @ishpaul777 |
|
Issue created -> #52640 |
|
i'll retest this today |
|
@ishpaul777 Worked fine for me: Screen.Recording.2024-11-18.at.23.16.40-source.mov |
srikarparsi
left a comment
There was a problem hiding this comment.
Just one small change but other than that it looks good to me
|
Added the reference. |
|
Awesome thanks! |
|
✋ 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.65-0 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.0.65-5 🚀
|
| const shouldShowPolicy = useMemo(() => PolicyUtils.shouldShowPolicy(policy, isOffline, currentUserLogin), [policy, isOffline, currentUserLogin]); | ||
| const prevShouldShowPolicy = useMemo(() => PolicyUtils.shouldShowPolicy(prevPolicy, isOffline, currentUserLogin), [prevPolicy, isOffline, currentUserLogin]); | ||
| // We check shouldShowPolicy and prevShouldShowPolicy to prevent the NotFound view from showing right after we delete the workspace | ||
| // eslint-disable-next-line rulesdir/no-negated-variables | ||
| const shouldShowNotFoundPage = | ||
| isEmptyObject(policy) || | ||
| // We check isPendingDelete for both policy and prevPolicy to prevent the NotFound view from showing right after we delete the workspace | ||
| (PolicyUtils.isPendingDeletePolicy(policy) && PolicyUtils.isPendingDeletePolicy(prevPolicy)); | ||
| const shouldShowNotFoundPage = isEmptyObject(policy) || (!shouldShowPolicy && !prevShouldShowPolicy); |
There was a problem hiding this comment.
Coming from #54582, we need to set isOffline to false here because shouldShowPolicy returns true for pending delete workspaces for the offline cases.
Proposal: #54582 (comment)
PR: #55579
|
The case in #55122 was missed while implementing the change. |

Details
Fixed Issues
$ #49093
PROPOSAL: #49093 (comment)
Tests
Precondition: User B has no workspace
Offline tests
NA
QA Steps
Precondition: User B has no workspace
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
Screen.Recording.2024-09-20.at.10.12.21.mov
Android: mWeb Chrome
Screen.Recording.2024-09-20.at.10.09.41.mov
iOS: Native
Screen.Recording.2024-09-20.at.10.02.41.mov
iOS: mWeb Safari
Screen.Recording.2024-09-20.at.10.05.46.mov
MacOS: Chrome / Safari
Screen.Recording.2024-09-20.at.09.51.20.mov
MacOS: Desktop
Screen.Recording.2024-09-20.at.10.06.52.mov