-
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
[HOLD for payment 2023-01-23] [$4000] Workspace - The welcome message does not appear immediately after deleting the workspace #13615
Comments
|
Current assignee @Christinadobrzyn is eligible for the External assigner, not assigning anyone new. |
Job added to Upwork: https://www.upwork.com/jobs/~010de9dc97b9a28579 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat ( |
Triggered auto assignment to @srikarparsi ( |
Proposal When we delete a workspace, we set the optimistic value with App/src/components/OfflineWithFeedback.js Lines 83 to 103 in 3620bf2
And after a while, we will receive a Pusher API update that will set the workspace item value to null. What we can do here is to change the condition to show the empty workspace view. Filter out all workspace with render() {
const workspaces = this.getWorkspaces();
+ const isWorkspacesEmpty = _.isEmpty(_.filter(workspaces, workspace => workspace.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE));
return (
<ScreenWrapper>
<HeaderWithCloseButton
title={this.props.translate('common.workspaces')}
shouldShowBackButton
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS)}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
+ {isWorkspacesEmpty ? (
- {_.isEmpty(workspaces) ? (
<BlockingView
icon={Expensicons.Building}
title={this.props.translate('workspace.emptyWorkspace.title')}
subtitle={this.props.translate('workspace.emptyWorkspace.subtitle')}
/>
) : (
<ScrollView style={styles.flex1}>
{_.map(workspaces, (item, index) => this.getMenuItem(item, index))}
</ScrollView>
)}
<FixedFooter style={[styles.flexGrow0]}>
<Button
success
text={this.props.translate('workspace.new.newWorkspace')}
onPress={() => Policy.createWorkspace()}
/>
</FixedFooter>
</ScreenWrapper>
);
}
Result 328546.t.mp4 |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
ProposalProblemWhen we delete the workspace we just update the we get all the policies and filter by Solutionwe shouldn't filter out the workspace that has pendingAction === 'delete' when we're in offline I'll filter out the workspace that has pendingAction === 'delete' when we're in online. In https://github.com/Expensify/App/blob/main/src/pages/workspace/WorkspacesListPage.js ...
getWorkspaces() {
return _.chain(this.props.policies)
.filter(policy => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.role === CONST.POLICY.ROLE.ADMIN)
+ .filter(policy => this.props.network.isOffline || policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)
...
export default compose(
withLocalize,
+ withNetwork(),
...
Screen.Recording.2022-12-16.at.10.23.23.mp4 |
Proposaldiff --git a/src/pages/workspace/WorkspacesListPage.js b/src/pages/workspace/WorkspacesListPage.js
index 41c6b3babe..2c037c685d 100755
--- a/src/pages/workspace/WorkspacesListPage.js
+++ b/src/pages/workspace/WorkspacesListPage.js
@@ -115,7 +115,10 @@ class WorkspacesListPage extends Component {
*/
getWorkspaces() {
return _.chain(this.props.policies)
- .filter(policy => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.role === CONST.POLICY.ROLE.ADMIN)
+ .filter(policy => policy
+ && policy.type === CONST.POLICY.TYPE.FREE
+ && policy.role === CONST.POLICY.ROLE.ADMIN
+ && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)
.map(policy => ({
title: policy.name,
icon: policy.avatar ? policy.avatar : Expensicons.Building,
@@ -128,7 +131,6 @@ class WorkspacesListPage extends Component {
pendingAction: policy.pendingAction,
errors: policy.errors,
dismissError: () => dismissWorkspaceError(policy.id, policy.pendingAction),
- disabled: policy.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
}))
.sortBy(policy => policy.title)
.value();
@@ -164,7 +166,6 @@ class WorkspacesListPage extends Component {
badgeText={this.getWalletBalance(isPaymentItem)}
fallbackIcon={item.fallbackIcon}
brickRoadIndicator={item.brickRoadIndicator}
- disabled={item.disabled}
/>
</OfflineWithFeedback>
); RCAI agree with the above @bernhardoj @tienifr analysis SolutionFilter out workspaces that have Alternative solutions
|
Reviewing. |
I'll be ooo till Jan 9th, assigning this issue to @mallenexpensify. Matt, I'm happy to take it back when I return! |
Proposal :- With all above proposals when we Regression Video :- Screen.Recording.2022-12-21.at.8.49.38.AM.movAs diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js
index 0f6784e7d..2bb5117eb 100644
--- a/src/libs/actions/Policy.js
+++ b/src/libs/actions/Policy.js
@@ -68,6 +68,7 @@ function deleteWorkspace(policyID, reports) {
value: {
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
errors: null,
+ lastAction : CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
},
},
..._.map(reports, ({reportID}) => ({
@@ -82,6 +83,7 @@ function deleteWorkspace(policyID, reports) {
})),
];
+
// Restore the old report stateNum and statusNum
const failureData = [
..._.map(reports, ({
diff --git a/src/pages/workspace/WorkspacesListPage.js b/src/pages/workspace/WorkspacesListPage.js
index 41c6b3bab..a79fce73d 100755
--- a/src/pages/workspace/WorkspacesListPage.js
+++ b/src/pages/workspace/WorkspacesListPage.js
@@ -114,8 +114,9 @@ class WorkspacesListPage extends Component {
* @returns {Array} the menu item list
*/
getWorkspaces() {
+
return _.chain(this.props.policies)
- .filter(policy => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.role === CONST.POLICY.ROLE.ADMIN
)
+ .filter(policy => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.role === CONST.POLICY.ROLE.ADMIN && policy.lastAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)
.map(policy => ({
title: policy.name,
icon: policy.avatar ? policy.avatar : Expensicons.Building,
@@ -172,6 +173,7 @@ class WorkspacesListPage extends Component {
render() {
const workspaces = this.getWorkspaces();
return (
<ScreenWrapper>
<HeaderWithCloseButton After Fix :- Screen.Recording.2022-12-21.at.8.52.24.AM.movWe can also not filter list when we are offline if we want to ...
getWorkspaces() {
return _.chain(this.props.policies)
.filter(policy => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.role === CONST.POLICY.ROLE.ADMIN)
+ .filter(policy => this.props.network.isOffline || policy.lastAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)
...
export default compose(
withLocalize,
+ withNetwork(),
... After Offline Filtering Fix :- Screen.Recording.2022-12-21.at.9.05.25.AM.mov |
@syedsaroshfarrukhdot Nice catch, but this is not a regression from my proposal, this issue existed long before. Your solution does not address the root cause for that either. The workspace will appear again for a short period only if you create the workspace and delete it immediately (in very short time), here is the order of events:
As you see this is an edge case and we shouldn't prioritise it, besides the final results is the workspace being deleted and not visible (self fix) I think we still should go with my proposal, but just curious why you are adding the |
@s77rt Yes, I agree with your analysis it is an edge case and it can be handled on filtering I am using |
@syedsaroshfarrukhdot Thanks for the clarification, however I still think we should go with my proposal (without adding a new prop) as that's how we deal with similar cases https://github.com/Expensify/App/blob/main/src/pages/settings/InitialSettingsPage.js#L130-L137 As for the offline case, your explanation makes sense, I will update my proposal to cover the offline cases in few minutes in both Another question: Why you are using two filters calls? it's expensive to call functions in JS and iterate over the objects twice, just wrap them in one filter for future proposals. |
Proposal (Updated)diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js
index c2bf6b384b..18d1067f31 100755
--- a/src/pages/settings/InitialSettingsPage.js
+++ b/src/pages/settings/InitialSettingsPage.js
@@ -131,7 +131,7 @@ class InitialSettingsPage extends React.Component {
.filter(policy => policy
&& policy.type === CONST.POLICY.TYPE.FREE
&& policy.role === CONST.POLICY.ROLE.ADMIN
- && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)
+ && (this.props.network.isOffline || policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE))
.sortBy(policy => policy.name)
.pluck('avatar')
.value();
diff --git a/src/pages/workspace/WorkspacesListPage.js b/src/pages/workspace/WorkspacesListPage.js
index 41c6b3babe..5fc2446513 100755
--- a/src/pages/workspace/WorkspacesListPage.js
+++ b/src/pages/workspace/WorkspacesListPage.js
@@ -23,6 +23,7 @@ import Permissions from '../../libs/Permissions';
import Button from '../../components/Button';
import FixedFooter from '../../components/FixedFooter';
import BlockingView from '../../components/BlockingViews/BlockingView';
+import {withNetwork} from '../../components/OnyxProvider';
const propTypes = {
/* Onyx Props */
@@ -115,7 +116,10 @@ class WorkspacesListPage extends Component {
*/
getWorkspaces() {
return _.chain(this.props.policies)
- .filter(policy => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.role === CONST.POLICY.ROLE.ADMIN)
+ .filter(policy => policy
+ && policy.type === CONST.POLICY.TYPE.FREE
+ && policy.role === CONST.POLICY.ROLE.ADMIN
+ && (this.props.network.isOffline || policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE))
.map(policy => ({
title: policy.name,
icon: policy.avatar ? policy.avatar : Expensicons.Building,
@@ -222,4 +226,5 @@ export default compose(
key: ONYXKEYS.BETAS,
},
}),
+ withNetwork(),
)(WorkspacesListPage); Update
Kooha-2022-12-22-13-39-20.mp4 |
Agree with you will also post an updated proposal and will use one filter call to avoid it. |
For this, I don't really think there was a regression or we could've caught this earlier. This behavior was introduced back when we originally added workspaces into newDot. We have solid documentation on ensuring actions are done optimistically, so I think that should be sufficient in this case. |
I'd just check the box then @NikkiWines , I'm asking about the steps/process for updating TestRail here |
@mallenexpensify can you plz look into this, regression period is over. |
Thanks for the ping @jatinsonijs , sorry for the delay (I'm looking into why this was labeled |
@jatinsonijs I'm working on updating the regression steps and I see the final test step listed in your PR as
Yet, when I delete a workspace I:
So I'm not seeing a 'welcome message'. Am I missing something or are the two steps above the expected behavior? |
@mallenexpensify it is about this message |
I refer it as welcome message because in the issue title it is called as welcome message. |
Thanks @jatinsonijs, I was testing on Desktop. Was able to reproduce to get the screen above. |
Checking with QA about test step updates https://expensify.slack.com/archives/C9YU7BX5M/p1674676068594109 |
Checking in #qa again |
@mallenexpensify I have already applied for the job. Waiting for the offer, I guess. |
Hired @parasharrajat , can you please accept the job and reply here once you have? |
Done @mallenexpensify |
Paid $6K to @parasharrajat for +C, includes timeliness budget. Triple checking in #qa about steps |
Gonna propose these. https://expensify.slack.com/archives/C01SKUP7QR0/p1675268410262409 |
https://github.com/Expensify/Expensify/issues/259653 |
@parasharrajat , reviewing this issue. It appears your reviews took a while and the priced jumped from $1k to $4k before you reviewed the accepted proposal from @jatinsonijs. I think part (at least) of the reason was due to IP-related issues around this time. Please try to review proposals as promptly as possible to reduce the chance of prices unnecessarily doubling. 12/23 - @jatinsonijs proposal |
Sure, I am fully active at this time. I was partly available at that time. Also, we were facing a few blockers. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The welcome message appears immediately
Actual Result:
The welcome message does not appear immediately - it blinks
Workaround:
Unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.39.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Bug5864228_Recording__3280.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: