-
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 2024-08-14] [$250] Workspace - Not found page briefly appear on Accounting feature #45517
Comments
Triggered auto assignment to @jasperhuangg ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Definitely doesn't need to be a blocker since the functionality still works as expected. It looks like something is wrong with the data returned by the API? |
Based on my reproduction here it seems like I think this can actually be worked on externally. |
Job added to Upwork: https://www.upwork.com/jobs/~010656791d40958772 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The "Accounting" integration returns a "Not Found" page when enabled in offline mode. What is the root cause of that problem?src/libs/actions/Policy/Policy.ts sucessData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
pendingFields: {
areConnectionsEnabled: null,
},
}, The success data set by Onyx, reverts the Optimistic data that was set while offline. What changes do you think we should make in order to solve the problem? successData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
areConnectionsEnabled: enabled,
pendingFields: {
areConnectionsEnabled: null,
},
}, Set the success data to enable the connection. I've observed that connection is enabled on page reload. What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.Workspace - Not found page briefly appear on Accounting feature What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?We need to follow the same approach used in App/src/pages/workspace/WorkspaceInitialPage.tsx Lines 213 to 228 in 52b8fdd
// In AccessOrNotFoundWrapper
const policyFeatureStates = useMemo(
() => ({
[CONST.POLICY.MORE_FEATURES.ARE_DISTANCE_RATES_ENABLED]: policy?.areDistanceRatesEnabled,
[CONST.POLICY.MORE_FEATURES.ARE_WORKFLOWS_ENABLED]: policy?.areWorkflowsEnabled,
[CONST.POLICY.MORE_FEATURES.ARE_CATEGORIES_ENABLED]: policy?.areCategoriesEnabled,
[CONST.POLICY.MORE_FEATURES.ARE_TAGS_ENABLED]: policy?.areTagsEnabled,
[CONST.POLICY.MORE_FEATURES.ARE_TAXES_ENABLED]: policy?.tax?.trackingEnabled,
[CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED]: policy?.areConnectionsEnabled,
[CONST.POLICY.MORE_FEATURES.ARE_EXPENSIFY_CARDS_ENABLED]: policy?.areExpensifyCardsEnabled,
[CONST.POLICY.MORE_FEATURES.ARE_REPORT_FIELDS_ENABLED]: policy?.areReportFieldsEnabled,
}),
[policy],
) as PolicyFeatureStates;
const [featureStates, setFeatureStates] = useState(policyFeatureStates);
const prevPendingFields = usePrevious(policy?.pendingFields);
useEffect(() => {
setFeatureStates((currentFeatureStates) => {
const newFeatureStates = {} as PolicyFeatureStates;
(Object.keys(policy?.pendingFields ?? {}) as PolicyFeatureName[]).forEach((key) => {
const isFeatureEnabled2 = PolicyUtils.isPolicyFeatureEnabled(policy, key);
newFeatureStates[key] =
prevPendingFields?.[key] !== policy?.pendingFields?.[key] || isOffline || !policy?.pendingFields?.[key] ? isFeatureEnabled2 : currentFeatureStates[key];
});
return {
...policyFeatureStates,
...newFeatureStates,
};
});
}, [policy, isOffline, policyFeatureStates, prevPendingFields]);
const isFeatureEnabled = featureName ? featureStates?.[featureName] : true;
const isPolicyNotAccessible = isEmptyObject(policy) || (Object.keys(policy).length === 1 && !isEmptyObject(policy.errors)) || isFeatureEnabled || !policy?.id;
const isPageAccessible = accessVariants.reduce((acc, variant) => {
const accessFunction = ACCESS_VARIANTS[variant];
return acc && accessFunction(policy, login, report, allPolicies ?? null, iouType);
}, true);
const shouldShowNotFoundPage = (!isMoneyRequest && !isFromGlobalCreate && isPolicyNotAccessible) || !isPageAccessible || shouldBeBlocked; The code will be repeated so we should create a custom hook for this. What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
and this
What alternative solutions did you explore? (Optional)
See Test branch |
Updated proposal to fix the minor typo issue |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @Zakpak0 You have been assigned to this job! |
@Zakpak0's proposal seems simple and fits within our existing patterns. Assigned! |
@jasperhuangg The selected proposal does not fix the issue, I still can reproduce the bug when applying it. Can you help confirm @DylanDylann? |
@Krishna2323 Please provide a test branch or detail implementation then I can test this approach. Thanks |
@DylanDylann I've updated my alternative solution with detailed code changes, explanations, and a test branch. This alternative is essentially the second approach within my main solution. |
@jasperhuangg, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Proposals still under review |
@DylanDylann bump on proposal review! |
@dominictb's alternative solution looks good to me 🎀 👀 🎀 C+ reviewed |
Current assignee @jasperhuangg is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
It makes sense to me as well, thank you for the investigation and discussion @DylanDylann. @dominictb let's move forward with implementing your alternative proposal! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.17-2 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-08-14. 🎊 For reference, here are some details about the assignees on this issue:
|
Issue is ready for payment but no BZ is assigned. @OfstadC you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks! |
Payment Summary
|
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.7-4
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): dave0123seife@gmail.com
Issue reported by: Applause - Internal Team
Issue found when executing PR #45239
Action Performed:
Expected Result:
No "not found" page appears
Actual Result:
Not found page briefly appear
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6544046_1721141224071.Fail_PR_45239.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @DylanDylannThe text was updated successfully, but these errors were encountered: