-
Notifications
You must be signed in to change notification settings - Fork 3k
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
API Refactor - DeleteWorkspace - Offline pattern B #10491
Conversation
@@ -22,7 +23,7 @@ Onyx.connect({ | |||
return; | |||
} | |||
|
|||
allPolicies[key] = {...allPolicies[key], ...val}; | |||
allPolicies[key] = val; |
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.
This was not allowing us to remove keys (like errors
) from a policy. It kept adding it back.
if (hasPolicyMemberError(policyMemberList) || hasPolicyError(policy) || hasCustomUnitsError(policy)) { | ||
if (hasPolicyMemberError(policyMemberList) || hasCustomUnitsError(policy)) { |
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.
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 |
No. Believe. me I tried refresh, hard refresh, signout and signin. It doesn't load up. Anyway to check from the backend? My username is |
@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? |
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.
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.com
and create workspace invitingworkspace-employee@expensifail.com
as an employee andworkspace-admin@expensifail.com
as 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.#announce
and#admin
workspace-admin@expensifail.com
should see all policy expense chats and the two rooms (the same chats the owner can see)workspace-employee@expensifail.com
should see only his policy expense chat and the#announce
roomworkspace-admin@expensifail.com
:#announce
and#admins
) should change to archived#announce
room and the policy expense chat should change to archivedOffline test:
Online section
account 1
in NewDotaccount 2
in NewDotaccount 1
and inviteaccount 2
as a memberaccount 1
:account 2
account 2
account 2
has the second workspace chataccount 1
, delete the workspace:account 1
Offline section
account 1
and inviteaccount 2
Delete Workspace
(in the menu that appears when the 3 vertical dots are clicked)PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is 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 Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
See "Tests / QA" section above
This is the same as the "Tests" section, but without the
admin
account because we cannot add that through the UI in staging/productionworkspace-owner@expensifail.com
and create workspace invitingworkspace-employee@expensifail.com
#announce
and#admins
workspace-employee@expensifail.com
should see only his policy expense chat and the#announce
room#announce
and#admins
) should change to archived#announce
room 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