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
2.99k stars 2.5k forks source link

Expense Report - System message does not appear in real time when updating report title #41845

Closed lanitochka17 closed 1 week ago

lanitochka17 commented 1 week 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: 1.4.71-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Create a workspace
  3. Turn on workflow for the workspace and turn on approvals
  4. Go to workspace chat and create two expenses and submit it
  5. Open the expense report page and rename the report
  6. Go back to the workspace chat and return back to expense report page
  7. Do step 5 - 6 again

Expected Result:

The system message stating the report has been renamed gets appears in real time as soon as the report gets renamed

Actual Result:

The system message holds stale data, user has to go back to workspace chat and return to expense report to view the updated system message

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/7a53a6dc-e7e9-497c-81eb-066b1d01bf1b

View all open jobs on GitHub

melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @joekaufmanexpensify (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.

lanitochka17 commented 1 week ago

@joekaufmanexpensify 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

lanitochka17 commented 1 week ago

We think that this bug might be related to #wave-collect - Release 1

nkdengineer commented 1 week ago

Proposal

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

The system message holds stale data, user has to go back to workspace chat and return to expense report to view the updated system message

What is the root cause of that problem?

  1. When we rename the report, we don't create optimistic data for rename action

https://github.com/Expensify/App/blob/807c945ef8edabe86cc62f16c866aa754db8750b/src/libs/actions/Report.ts#L1691

  1. Backend doesn't return the data of rename action in RenameReport API
Screenshot 2024-05-09 at 11 43 11

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

  1. We should create optimistic data for rename action, we can create a util like buildOptimisticDataRenameReportAction in ReportUtil and the data of rename action like this image. Also this will have pendingAction as add and we will generate the error for this action in failureData
Screenshot 2024-05-09 at 11 44 14

https://github.com/Expensify/App/blob/807c945ef8edabe86cc62f16c866aa754db8750b/src/libs/actions/Report.ts#L1691

  1. For RenameReport API, We should accept an extra param like renameReportActionID that is the reportActionID of rename action that we generated in buildOptimisticDataRenameReportAction and use this to create the rename action in backend. We also need to return rename report action data in the response of this API

What alternative solutions did you explore? (Optional)

NA

joekaufmanexpensify commented 1 week ago

I can't reproduce this on my end. I'm thinking maybe this comes down to the timing of the API, and if it's slower, we don't load it in the frontend if we don't have the response from the backend in time?

Not sure this really feels like worth prioritizing right now, especially since I think we are doing a lot of work to make the site more performant. I am inclined to think we can close this for now, and see if any actual customers report this, or it becomes consistently reproducible.

https://github.com/Expensify/App/assets/54866469/1eaa9e2b-07f7-496d-ade0-7ba67116c1e3

joekaufmanexpensify commented 1 week ago

Going to close for now