Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.79k forks source link

[$250] Invoice - Invoice title page shows not here page #47003

Closed izarutskaya closed 6 days ago

izarutskaya commented 1 month ago

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.17-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): biruknew45+2293dh@gmail.com Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team

Action Performed:

  1. Go to [staging.new.expensify.com].
  2. Click on the floating action button (FAB).
  3. Click on "new workspace" at the bottom.
  4. It takes you to the workspace editor. Navigate to the settings page by clicking on the back button at the top left corner only once.
  5. Stay on the settings page and click on the FAB.
  6. Select "send invoice."
  7. Enter the amount.
  8. Enter the user.
  9. Verify that the "send from" workspace is the same as the workspace you created.
  10. Click on "send invoice."
  11. It takes you to the invoice chat. Open the invoice preview. (You might need to open another chat and come back to the invoice chat to see the preview.)
  12. Click on the header.
  13. Click on the title.

Expected Result:

The title page should open.

Actual Result:

A "hmm... it's not here" page appears, and both the "back" button and the "go back to home page" link are not responsive

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

https://github.com/user-attachments/assets/364d7056-5963-49fd-a929-9686324ef84d

Bug6554644_1722082038003!1

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d7c703877e9d58e3
  • Upwork Job ID: 1823549296018846731
  • Last Price Increase: 2024-09-18
Issue OwnerCurrent Issue Owner: @eVoloshchak
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

dominictb commented 1 month ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

A "hmm... it's not here" page appears, and both the "back" button and the "go back to home page" link are not responsive

What is the root cause of that problem?

fieldList data can be object or array. After creating workspace, fieldList is array, so in https://github.com/Expensify/App/blob/53eee53ac8bfbdfd4d8eeaf16940e3b165483373/src/pages/EditReportFieldPage.tsx#L53 policy?.fieldList?.[fieldKey] is undefined so reportField is undefined so condition: https://github.com/Expensify/App/blob/53eee53ac8bfbdfd4d8eeaf16940e3b165483373/src/pages/EditReportFieldPage.tsx#L60 is true.

That issue does not appear in ReportDetailPage because we use: https://github.com/Expensify/App/blob/53eee53ac8bfbdfd4d8eeaf16940e3b165483373/src/pages/ReportDetailsPage.tsx#L628-L631 which works well regardless the policy.fieldList is array or object.

What changes do you think we should make in order to solve the problem?

We should use:

    const reportField = report?.fieldList?.[fieldKey] ?? (isArray(policy?.fieldList) ? policy?.fieldList?.find((o) => o.fieldID === fieldKey) : policy?.fieldList?.[fieldKey]);

in: https://github.com/Expensify/App/blob/53eee53ac8bfbdfd4d8eeaf16940e3b165483373/src/pages/EditReportFieldPage.tsx#L53

What alternative solutions did you explore? (Optional)

We can use the same as what we did in: https://github.com/Expensify/App/blob/53eee53ac8bfbdfd4d8eeaf16940e3b165483373/src/pages/ReportDetailsPage.tsx#L628-L631 to make sure it works in both case the policy.fieldList is array or object

    const reportField = report?.fieldList?.[fieldKey] ?? Object.values(policy?.fieldList).find((o) => o.fieldID === fieldKey);

We can remove 2 lines: https://github.com/Expensify/App/blob/53eee53ac8bfbdfd4d8eeaf16940e3b165483373/src/pages/EditReportFieldPage.tsx#L69-L70 as well.

zinzaducnm commented 1 month ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

A "hmm... it's not here" page appears, and both the "back" button and the "go back to home page" link are not responsive

What is the root cause of that problem?

/** Report fields attached to the policy */
fieldList?: Record<string, OnyxCommon.OnyxValueWithOfflineFeedback<PolicyReportField>>;

fieldList data is defined as an object. But after creating workspace, fieldList in respoonse.policy is array. I can see it in console log as below

Finished API request in 750ms - {"command":"CreateWorkspace","jsonCode":200,"requestID":"8b1d5cfa4c3584ed-HKG"}
{
    "approvalMode": "OPTIONAL",
    ...
    "fieldList": [
        {
            "defaultExternalID": null,
            "defaultValue": "{report:type} {report:startdate}",
            "deletable": true,
            "disabledOptions": [],
            "externalID": null,
            "externalIDs": [],
            "fieldID": "text_title",
            "isTax": false,
            "keys": [],
            "name": "title",
            "orderWeight": 0,
            "origin": null,
            "target": "expense",
            "type": "formula",
            "value": null,
            "values": []
        }
    ],
    ...
    "id": "F8AC0C1478D5ECBE",
    "ownerAccountID": 16529869
}

In WorkspaceProfilePage, there is an API request to get policy from BE (Policy.openPolicyProfilePage(route.params.policyID);) to update fieldList to right object. But this API cannot be called because queue is paused. https://github.com/Expensify/App/blob/66ae37403897f907d26e5dcb3b1b3744ea1055da/src/pages/workspace/WorkspaceProfilePage.tsx#L97 I find in logs that there are gaps between deferred updates. So shouldPauseQueue is set to true to ensure the client resolves the gap in onyx updates

After sending invoice to user and choosing send from the new workspace, an error occurred when visiting EditReportFieldPage. https://github.com/Expensify/App/blob/66ae37403897f907d26e5dcb3b1b3744ea1055da/src/pages/EditReportFieldPage.tsx#L53 This happens because policy?.fieldList? is an array and you cannot get right reportField. The FullPageNotFoundView is shown. https://github.com/Expensify/App/blob/66ae37403897f907d26e5dcb3b1b3744ea1055da/src/pages/EditReportFieldPage.tsx#L60

What changes do you think we should make in order to solve the problem?

What alternative solutions did you explore? (Optional)

We can fix it tempolary at client side to get right fieldList by using this code to replace the code at line 53 of EditReportFieldPage.tsx: https://github.com/Expensify/App/blob/66ae37403897f907d26e5dcb3b1b3744ea1055da/src/pages/EditReportFieldPage.tsx#L53

    const reportField = report?.fieldList?.[fieldKey] ?? (isArray(policy?.fieldList) ? policy?.fieldList?.find((o) = o.fieldID === fieldKey) : policy?.fieldList?.[fieldKey]);
melvin-bot[bot] commented 1 month ago

@anmurali Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~01d7c703877e9d58e3

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

melvin-bot[bot] commented 1 month ago

@eVoloshchak, @anmurali Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 1 month ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 1 month ago

@eVoloshchak @anmurali this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] commented 1 month ago

@eVoloshchak, @anmurali Still overdue 6 days?! Let's take care of this!

mvtglobally commented 1 month ago

Issue not reproducible during KI retests. (First week)

melvin-bot[bot] commented 1 month ago

@eVoloshchak, @anmurali Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

eVoloshchak commented 1 month ago

Cannot reproduce this issue either, @dominictb, @zinzaducnm, could you please double check if this is still reproducible for you?

zinzaducnm commented 1 month ago

@eVoloshchak I cannot reproduce now. I checked the log and saw that:

As I inspected it in my proposal

In WorkspaceProfilePage, there is an API request to get policy from BE (Policy.openPolicyProfilePage(route.params.policyID);) to update fieldList to right object. But this API cannot be called because queue is paused.

It seems issue related to queue not happening anymore.

dominictb commented 1 month ago

Cannot reproduce this issue either, @dominictb, @zinzaducnm, could you please double check if this is still reproducible for you?

  1. Signin with new account.
  2. In onboarding steps, choose "Manage my team's expenses".
  3. Finish the onboarding flow.
  4. Click on the floating action button (FAB).
  5. Select "send invoice."
  6. Enter the amount.
  7. Enter the user.
  8. Verify that the "send from" workspace is the same as the workspace you created after onboarding flow. 9.Click on "send invoice."
  9. It takes you to the invoice chat. Open the invoice preview. (You might need to open another chat and come back to the invoice chat to see the preview.)
  10. Click on the header.
  11. Click on the title.
melvin-bot[bot] commented 1 month ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 1 month ago

@eVoloshchak, @anmurali Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 3 weeks ago

@eVoloshchak, @anmurali 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] commented 3 weeks ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 3 weeks ago

@eVoloshchak @anmurali this issue is now 4 weeks old, please consider:

Thanks!

melvin-bot[bot] commented 3 weeks ago

@eVoloshchak, @anmurali 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

dominictb commented 3 weeks ago

@eVoloshchak Can you reproduce this bug based on my suggestion?

melvin-bot[bot] commented 3 weeks ago

@eVoloshchak, @anmurali 12 days overdue now... This issue's end is nigh!

anmurali commented 3 weeks ago

Yes, I get an unexpected error in the send flow and then trying to change the title or description of the invoice triggers a its not here page error.

anmurali commented 3 weeks ago

@zinzaducnm - can you maybe retry and restate your proposal?

melvin-bot[bot] commented 2 weeks ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 2 weeks ago

@eVoloshchak, @anmurali Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 1 week ago

@eVoloshchak, @anmurali 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] commented 1 week ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

eVoloshchak commented 1 week ago

@dominictb, thank you for the steps, was able to reproduce the issue

I noticed two problems when applying your proposal

  1. The title in the header and the title on the edit invoice title page are not the same
  2. When you update the title, it isn't updated in the header

https://github.com/user-attachments/assets/eecea85b-6db2-487b-bf06-6e4a265f2b63

dominictb commented 1 week ago

@eVoloshchak I can also reproduce the above in latest main, so I think it is not related to my solution. Can you help check again?

mvtglobally commented 1 week ago

Issue not reproducible during KI retests. (Second week)

melvin-bot[bot] commented 6 days ago

@eVoloshchak, @anmurali Eep! 4 days overdue now. Issues have feelings too...