API Refactor - DeleteWorkspace - Offline pattern B#10491
Conversation
| } | ||
|
|
||
| allPolicies[key] = {...allPolicies[key], ...val}; | ||
| allPolicies[key] = val; |
There was a problem hiding this comment.
This was not allowing us to remove keys (like errors) from a policy. It kept adding it back.
| function getPolicyBrickRoadIndicatorStatus(policy, policyMembers) { | ||
| const policyMemberList = lodashGet(policyMembers, `${ONYXKEYS.COLLECTION.POLICY_MEMBER_LIST}${policy.id}`, {}); | ||
| if (hasPolicyMemberError(policyMemberList) || hasPolicyError(policy) || hasCustomUnitsError(policy)) { | ||
| if (hasPolicyMemberError(policyMemberList) || hasCustomUnitsError(policy)) { |
|
Web-E PR is on prod and hold is removed. @aldo-expensify is ooo until Sep 27th, so I'm bumping @stitesExpensify @mananjadhav for reviews! |
|
@luacmartins I cannot access the issue URL mentioned in the |
|
@mananjadhav oooh I think the problem is that that account is not in the |
|
Okay thanks that did it. I can see the chats from the previous workspaces as well. Thanks for helping out @luacmartins. 🎀 👀 🎀
|
|
@stitesExpensify can you re-review please? |
|
@mananjadhav glad it worked! Would you mind also approving the PR? |
mananjadhav
left a comment
There was a problem hiding this comment.
Filled the checklist in another comment.
|
@stitesExpensify looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Removing emergency, tests were passing |
|
🚀 Deployed to staging by @stitesExpensify in version: 1.2.6-0 🚀
|
|
Thank you guys for taking this to the end ❤️ ! |
|
I was looking at this issue because it came up on the deploy checklist, and did the following:
Looking at the network console, I see a lot of failed network requests, and it appears to me that the |
|
@roryabraham , when doing step 5 "Verify that workspace-employee sees:", did you sign in after the employee was invited? or was it already signed in when it was invited? I think we are not pushing the chats to users to make it appear for users that are already logged |
|
about step 8.ii, 8.iii, 8.iv yes, I didn't consider that part in the optimistic update, I just made the workspace disappear. Should we try to change that? not sure if it is easy or not to archive those chats/rooms in the optimistic update and then revert on fail. |
Yes, I signed in after the employee was invited.
Why not? imo we should do that, just like we would for any other new chat created.
Yeah, imo I think we should, since those chats are going to be archived by the action the user just took (archiving the workspace). I think this is important for this pattern B implementation to be considered complete, because if a user tried to send messages in one of those reports, not knowing that it was going to be archived, then those chats would disappear when they came back online (unless we did something different to try and work around that, like changing the order of serialized requests in the sequential queue, which is something I don't think we should do without widespread agreement) |
|
Update – I think some of the bugs I listed above can be attributed to #10524 |
I may not remember correctly, it's been a while since I tested before going on vacations... I think I saw that behaviour, but it was out of the scope of deleting workspace since that is related to creation.
Sounds good to me, I'll investigate on adding that part to the optimistic updates. |
|
Reopened the GH issue to handle the missing optimistic updates |
|
🚀 Deployed to production by @roryabraham in version: 1.2.6-0 🚀
|



Needs these PRs:
Details
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/215184
Tests
workspace-owner@expensifail.comand create workspace invitingworkspace-employee@expensifail.comas an employee andworkspace-admin@expensifail.comas an admin. To invite a user as an admin, for now, you will have to change the code here from{email: login}to{email: login, role: 'admin'}right before inviting the admin.#announceand#adminworkspace-admin@expensifail.comshould see all policy expense chats and the two rooms (the same chats the owner can see)workspace-employee@expensifail.comshould see only his policy expense chat and the#announceroomworkspace-admin@expensifail.com:#announceand#admins) should change to archived#announceroom and the policy expense chat should change to archivedOffline test:
Online section
account 1in NewDotaccount 2in NewDotaccount 1and inviteaccount 2as a memberaccount 1:account 2account 2account 2has the second workspace chataccount 1, delete the workspace:account 1Offline section
account 1and inviteaccount 2Delete Workspace(in the menu that appears when the 3 vertical dots are clicked)PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly 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 Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */displayNamepropertythisproperly 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)QA Steps
See "Tests / QA" section above
This is the same as the "Tests" section, but without the
adminaccount because we cannot add that through the UI in staging/productionworkspace-owner@expensifail.comand create workspace invitingworkspace-employee@expensifail.com#announceand#adminsworkspace-employee@expensifail.comshould see only his policy expense chat and the#announceroom#announceand#admins) should change to archived#announceroom and the policy expense chat should change to archivedOffline test:
Screenshots
Web
After deleting the workspace while being offline:
The backend pushing an error:
Mobile Web
Desktop
iOS
Android