You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-05-03] [$500] [Workflows] Workspace - "Hmm it's not here" error appears briefly when enabling workflows #39443
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
@puneetlath FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Please re-state the problem that we are trying to solve in this issue.
"Hmm it's not here" error appears briefly when enabling workflows
What is the root cause of that problem?
The main problem with issue is that when we create a new workspace we are waiting for a response from the server
And if during this period of time we enable PolicyWorkflows we will add enablePolicyWorkflows to the queue
But after enabling PolicyWorkflows we will navigate to the PolicyWorkflows screen and make request to get current state of policy which is still disabled
As result we will have here is list of event
Create workspace ( PolicyWorkflows is disabled) (API.write)
Press on the radio button ( PolicyWorkflows is enabled) (API.write) - still waiting first event
Navigate to the PolicyWorkflows screen
Get answer from create workspace ( PolicyWorkflows is disabled) (At this moment we have the issue)
Get answer from changing state of PolicyWorkflows(PolicyWorkflows is enabled)
What changes do you think we should make in order to solve the problem?
To fix this issue we can update our FeatureEnabledAccessOrNotFoundComponent and depending on pendingFields(which we will change after press on radio button) we will update our policyFeature to prevent unnecessary changes while we are waiting for a response from the server
const isPolicyIDInRoute = !!props.policyID?.length;
const [isPolicyFeatureEnabled, setIsPolicyFeatureEnabled] = useState(PolicyUtils.isPolicyFeatureEnabled(props.policy, props.featureName));
const shouldShowFullScreenLoadingIndicator = props.isLoadingReportData !== false && (!Object.entries(props.policy ?? {}).length || !props.policy?.id);
const shouldShowNotFoundPage = isEmptyObject(props.policy) || !props.policy?.id || !isPolicyFeatureEnabled;
const {isOffline} = useNetwork();
useEffect(() => {
if (!isPolicyIDInRoute || !isEmptyObject(props.policy)) {
// If the workspace is not required or is already loaded, we don't need to call the API
return;
}
Policy.openWorkspace(props.policyID, []);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isPolicyIDInRoute, props.policyID]);
useEffect(() => {
if (props.policy?.pendingFields?.[props.featureName] === 'update' && !PolicyUtils.isPolicyFeatureEnabled(props.policy, props.featureName) && !isOffline) {
return;
}
setIsPolicyFeatureEnabled(PolicyUtils.isPolicyFeatureEnabled(props.policy, props.featureName));
}, [props.policy?.pendingFields?.[props.featureName], PolicyUtils.isPolicyFeatureEnabled(props.policy, props.featureName)]);
Here we add useState and useEffect. And only when props.policy?.pendingFields?.[props.featureName] will be null we will update isPolicyFeatureEnabled to be sure that we receive only current data from the server
What alternative solutions did you explore? (Optional)
As alternative we can show isLoading while we are waiting answer from server
In case of offline mode we will not use pendingFields
Since I mentioned that the issue is related to the server response
In this case, displaying content will work as expected
changed the title [-]Workspace - "Hmm it's not here" error appears briefly when enabling workflows[/-][+][$500] Workspace - "Hmm it's not here" error appears briefly when enabling workflows[/+]on Apr 3, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.66-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@hungvu193] The PR that introduced the bug has been identified. Link to the PR:
[@hungvu193] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@hungvu193] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@hungvu193] Determine if we should create a regression test for this bug.
[@hungvu193] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
Determine if we should create a regression test for this bug.
This is new feature and we're still developing it so I don't think we need regression test for this one.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Activity
melvin-bot commentedon Apr 2, 2024
Triggered auto assignment to @puneetlath (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.lanitochka17 commentedon Apr 2, 2024
@puneetlath FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
ZhenjaHorbach commentedon Apr 3, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
"Hmm it's not here" error appears briefly when enabling workflows
What is the root cause of that problem?
The main problem with issue is that when we create a new workspace we are waiting for a response from the server
And if during this period of time we enable PolicyWorkflows we will add enablePolicyWorkflows to the queue
But after enabling PolicyWorkflows we will navigate to the PolicyWorkflows screen and make request to get current state of policy which is still disabled
As result we will have here is list of event
What changes do you think we should make in order to solve the problem?
To fix this issue we can update our
FeatureEnabledAccessOrNotFoundComponentand depending on pendingFields(which we will change after press on radio button) we will update our policyFeature to prevent unnecessary changes while we are waiting for a response from the serverApp/src/pages/workspace/FeatureEnabledAccessOrNotFoundWrapper.tsx
Lines 35 to 48 in 514bc3b
Here we add useState and useEffect. And only when
props.policy?.pendingFields?.[props.featureName]will be null we will update isPolicyFeatureEnabled to be sure that we receive only current data from the serverWhat alternative solutions did you explore? (Optional)
As alternative we can show isLoading while we are waiting answer from server
In case of offline mode we will not use pendingFields
Since I mentioned that the issue is related to the server response
In this case, displaying content will work as expected
App/src/pages/workspace/FeatureEnabledAccessOrNotFoundWrapper.tsx
Line 37 in 514bc3b
melvin-bot commentedon Apr 3, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01f589bc2448420016
[-]Workspace - "Hmm it's not here" error appears briefly when enabling workflows[/-][+][$500] Workspace - "Hmm it's not here" error appears briefly when enabling workflows[/+]melvin-bot commentedon Apr 3, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (
External)hungvu193 commentedon Apr 4, 2024
Hey! How can I re-enable workflow once I enabled it?
Screen.Recording.2024-04-04.at.10.05.49.mov
ZhenjaHorbach commentedon Apr 4, 2024
Do you mean to open more features ?
And then turn workflows off and on ?)
hungvu193 commentedon Apr 4, 2024
Oh god 🤦 , silly me. Thank you.
63 remaining items
[-][$500] [Workflows] Workspace - "Hmm it's not here" error appears briefly when enabling workflows[/-][+][HOLD for payment 2024-05-03] [$500] [Workflows] Workspace - "Hmm it's not here" error appears briefly when enabling workflows[/+]melvin-bot commentedon Apr 26, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 26, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.66-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-05-03. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 26, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
puneetlath commentedon May 1, 2024
@hungvu193 friendly reminder on the checklist so that we can pay in a couple days.
hungvu193 commentedon May 2, 2024
This is new feature and we're still developing it so I don't think we need regression test for this one.
puneetlath commentedon May 3, 2024
All paid. Thanks y'all!