App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-11-14] [$250] Report Field- Report fields values do not update on system message until refresh the page

Open lanitochka17 opened this issue 1 year ago β€’ 39 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.41-10 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 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause - Internal Team

Action Performed:

Preconditions: Existing workspace with report fields enabled and report fields set up

  1. Navigate to workspace chat
  2. Create new manual expense
  3. Open the expense and submit it
  4. Change Description
  5. Change any of the report fields value
  6. Notice the system messages for the changes
  7. Refresh the page and notice the change in system message

Expected Result:

Report fields values update shown on system message instantly

Actual Result:

Report fields values update doesn't shown on system message instantly until refreshed

Workaround:

Unknown

Platforms:

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

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/ed7153d4-bfc3-4fad-a52f-38536739781f

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021841468586674370606
  • Upwork Job ID: 1841468586674370606
  • Last Price Increase: 2024-10-02
  • Automatic offers:
    • nkdengineer | Contributor | 104262442
Issue OwnerCurrent Issue Owner: @sonialiap

lanitochka17 avatar Oct 01 '24 19:10 lanitochka17

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

melvin-bot[bot] avatar Oct 01 '24 19:10 melvin-bot[bot]

@sonialiap 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 avatar Oct 01 '24 19:10 lanitochka17

Proposal

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

Report fields values do not update on system message until refresh the page

What is the root cause of that problem?

When we edit the report field, BE doesn't return the report field in response and we also don't create the optimistic action for the change field action.

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

In updateReportField function, we should create an optimistic change field action follow the action that BE returns and reset it in failure data or set an error. We also need to send reportActionID of the optimistic change field action to the payload of Report_SetFields API then BE can use this ID to generate the change field action from BE.

https://github.com/Expensify/App/blob/7dde09e01e77ba55a79d043847b7ff86c5c1d1fd/src/libs/actions/Report.ts#L1907

What alternative solutions did you explore? (Optional)

nkdengineer avatar Oct 02 '24 03:10 nkdengineer

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

melvin-bot[bot] avatar Oct 02 '24 13:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 02 '24 13:10 melvin-bot[bot]

@nkdengineer proposal looks good to me. Also requires fix in BE πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

aimane-chnaif avatar Oct 02 '24 21:10 aimane-chnaif

Triggered auto assignment to @Gonals, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Oct 02 '24 21:10 melvin-bot[bot]

πŸ“£ @nkdengineer πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] avatar Oct 04 '24 11:10 melvin-bot[bot]

I'll raise PR today

nkdengineer avatar Oct 08 '24 03:10 nkdengineer

@sonialiap, @Gonals, @aimane-chnaif, @nkdengineer Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Oct 08 '24 18:10 melvin-bot[bot]

@Gonals please help to fix the BE bug and implement the required BE change in my proposal. Currently, I don't see any action after updating report fields and reload. Btw please send me an example of change_field action to fix on FE

nkdengineer avatar Oct 08 '24 18:10 nkdengineer

Currently working on higher priority travel stuff! It'll still take me a few days to get to this, sorry!

Gonals avatar Oct 09 '24 08:10 Gonals

PR for the backend in place @nkdengineer.

In Newdot, we only change one field at a time, but, in the backend, we handle this like it could potentially be more than one, so we need to pass the optimisticActionID as an array.

The backend expects an array called reportFieldsActionIDs in the same shape as reportFields: reportFields: JSON.stringify({[fieldKey]: reportField}), reportFieldsActionIDs: JSON.stringify({[fieldKey]: reportFieldActionID}),

Once the frontend PR is ready, let me know and I'll test both of them together

Gonals avatar Oct 10 '24 11:10 Gonals

@sonialiap, @Gonals, @aimane-chnaif, @nkdengineer 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Oct 10 '24 18:10 melvin-bot[bot]

@Gonals Thanks for your information, will raise the FE PR soon.

nkdengineer avatar Oct 11 '24 09:10 nkdengineer

@Gonals Here is the FE PR. Once you have tested this completely, I will complete the test step and videos.

nkdengineer avatar Oct 14 '24 09:10 nkdengineer

Thanks! I'll test tomorrow morning!

Gonals avatar Oct 14 '24 14:10 Gonals

@sonialiap, @Gonals, @aimane-chnaif, @nkdengineer 10 days overdue. I'm getting more depressed than Marvin.

melvin-bot[bot] avatar Oct 14 '24 18:10 melvin-bot[bot]

Backend seems to be working and returning the Onyx update correctly. There seems to be a bug in the frontend where the backend-returned reportAction is not displayed, but that should be easy to figure out and fix after the backend merges @nkdengineer

Gonals avatar Oct 15 '24 14:10 Gonals

@sonialiap @Gonals @aimane-chnaif @nkdengineer 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] avatar Oct 15 '24 18:10 melvin-bot[bot]

@sonialiap, @Gonals, @aimane-chnaif, @nkdengineer 12 days overdue. Walking. Toward. The. Light...

melvin-bot[bot] avatar Oct 16 '24 18:10 melvin-bot[bot]

@Gonals what is deploy status of backend PR?

aimane-chnaif avatar Oct 16 '24 18:10 aimane-chnaif

Receive optimistic action IDs for report setField actions Expensify/Web-Expensify#43900

Merged, not yet on Staging. Should deploy to staging sometime today

Gonals avatar Oct 17 '24 09:10 Gonals

@sonialiap, @Gonals, @aimane-chnaif, @nkdengineer Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Oct 22 '24 18:10 melvin-bot[bot]

@Gonals any update here

nkdengineer avatar Oct 23 '24 03:10 nkdengineer

Backend should be deployed πŸ‘

Gonals avatar Oct 24 '24 09:10 Gonals

@sonialiap, @Gonals, @aimane-chnaif, @nkdengineer 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Oct 24 '24 18:10 melvin-bot[bot]

waiting for frontend PR from @nkdengineer

aimane-chnaif avatar Oct 28 '24 06:10 aimane-chnaif

@Gonals While testing, I found a problem, BE returns message of the change field action as empty which causes it is marked as deleted and disappears after the API is complete

Screenshot 2024-10-29 at 21 43 27

nkdengineer avatar Oct 29 '24 14:10 nkdengineer

https://github.com/Expensify/App/pull/50710 @aimane-chnaif The PR is ready.

nkdengineer avatar Oct 29 '24 15:10 nkdengineer