[Internal QA] Update error pattern for delete workspace#64015
Conversation
|
@shubham1206agra 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] |
| } | ||
|
|
||
| // eslint-disable-next-line rulesdir/no-api-side-effects-method, rulesdir/no-multiple-api-calls | ||
| API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.DELETE_WORKSPACE, params, {optimisticData, finallyData, failureData}).then((response) => { |
There was a problem hiding this comment.
@blimpich I don't think this is a good pattern at all.
There was a problem hiding this comment.
@shubham1206agra Please elaborate why you think it isn't a good pattern when giving PR feedback. I'm going to assume you think it is bad because we're no suppose to use makeRequestWithSideEffects, and I'd agree. As it says in the documentation for the method, it should only be used "when all other alternatives have been exhausted."
Not sure why you are pinging me on this, did you think that I wanted us to use makeRequestWithSideEffects?
There was a problem hiding this comment.
I am really sorry. I think my edit is not published to GH.
Let me write this again.
The reason why I am saying this is that we don't have another way to do this yet. So I want to make a proposal here. Introduce a property in policy object named errorKey, which will return error translation key. It will help us getting localized errors.
There was a problem hiding this comment.
@dominictb Can you please use write method? Somehow detect if the user is on the same page when deleting workspace and show the error in pop-up if that's the case, otherwise show the error in red dot indicator.
There was a problem hiding this comment.
Ah yes that makes more sense now, thank you for clarifying! Yes I can update the backend to make it return an error key on the policy object 👍 🙂
There was a problem hiding this comment.
Issue for this: #64098, will have a PR up today and hopefully will be deployed by tomorrow
There was a problem hiding this comment.
@shubham1206agra I still didn't get why we need the errorKey here, like what would it solve in this scenario? Also can you elaborate your approach when using API.write?
I know a way to handle the BE error, but in the HTTP layer, but I think this is even worse than makeRequestWithSideEffects:
Lines 146 to 149 in 5420e2a
There was a problem hiding this comment.
@dominictb Show modal only if the user is on the workspace list page. Otherwise, the red dot indicator with a message is fine.
|
@dominictb Can you mark this PR as draft? |
|
Will test once Ben is online. |
|
@dominictb Bump here |
|
Sorry I missed this one last weekend. Will check back when Ben is online (maybe in 4 - 5 hours). |
|
To detect if the deletion took place within the same
I haven't got a solution for all of them yet. I think for cases where we rely on BE response like this, requests with side effects are fine. |
|
@dominictb Just add the modal in |
|
Summary:
@blimpich Can we ever have multiple workspaces with this same error? Currently I assume we can only have 1 such workspace. Because when I tried to create a new workspace, it said: |
No it should also show also show the modal from the workspace overview page. The following screen recording shows the current behavior: Screen.Recording.2025-07-08.at.11.41.22.AM.movThis should be updated so that it shows the modal on the workspace overview page if the user triggers this error from that screen.
If that's the best way to do it then that's fine with me. I feel like a better way would be to just stop displaying the error where we are currently displaying it and only display policies errors as a modal. Closing out the modal would clear the onyx error in that situation. But not sure of the implementation details and what would work best here.
No I think you can only get this error with one remaining workspace/policy. But not 100% certain on that. That error that you're getting is a different, separate bug that I'll handle 👍 |
Currently after deleting the workspace, we navigate back to the workspaces list page. It's already the right behavior before this PR. I don't think we should reopen the workspace overview page just to display the modal when the delete was not successful.
Yes. We only show RBR in that case.
That would be quite intriguing to bring this logic to other places like the workspace icon in left-hand sidebar and the workspace item row. I think clearing the error before the modal is best for now if it does not cause any specific problem.
Got it, thanks! |
Codecov Report❌ Patch coverage is
... and 94 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Latest behavior: Online:
Offline:
Screen.Recording.2025-10-14.at.01.44.48-compressed.movScreen.Recording.2025-10-14.at.01.43.54-compressed.movScreen.Recording.2025-10-14.at.01.43.26-compressed.mov |
|
@dominictb behavior looks perfect 👍 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeScreen.Recording.2025-10-15.at.7.36.17.PM.moviOS: HybridAppScreen.Recording.2025-10-15.at.8.48.17.PM.moviOS: mWeb SafariScreen.Recording.2025-10-15.at.7.28.53.PM.movMacOS: Chrome / SafariScreen.Recording.2025-10-15.at.7.26.50.PM.movMacOS: DesktopScreen.Recording.2025-10-15.at.8.41.04.PM.mov |
|
✋ 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/blimpich in version: 9.2.32-0 🚀
|
|
This PR might have caused #72759 |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.32-6 🚀
|

Explanation of Change
Fixed Issues
$ #63113
PROPOSAL:
Tests
Pre-requisites:
Online:
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Screen.Recording.2025-06-12.at.04.14.45.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2025-06-12.at.04.11.40.mov
Screen.Recording.2025-06-12.at.04.12.05.mov
MacOS: Chrome / Safari
Online case
Screen.Recording.2025-06-12.at.04.09.31.mov
Offline case
Screen.Recording.2025-06-12.at.04.09.54.mov
MacOS: Desktop